开发者

Does sendto() dst_addr arg matters if used on a raw socket with IP_HDRINCL set?

The question is almost all in the title.

I was w开发者_高级运维ondering, given that: - I use a raw socket (on GNU/Linux); - the option IP_HDRINCL is set so that I craft the IP headers by myself.

As the dest IP addr is provided in the crafted IP header, does the dst_addr argument still plays a role or is it totally useless & only here cause that's how the function prototype is ?


The destination address is used to route the packet - it'll be the key that's used for a routing table lookup to determine the next hop address to send it to. It should usually be the same as the destination address you set in the header.


No it does not matter.

What you enter in the headers is where the packet would go.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜