开发者

Is it possible to send udp packet via a v6 socket to a v4 dst?

开发者 https://www.devze.com 2023-01-05 17:45 出处:网络
when I use linux\'s \"sendto(....)\" to send some udp packet, I got \"invalid argument\" error from system.

when I use linux's "sendto(....)" to send some udp packet, I got "invalid argument" error from system. After some check, I found that I try to send a udp packet via a v6 socekt to a ipv4 destination , I'm开发者_开发知识库 not sure whether it is the reason why "invalid argument" comes from system, so want to raise my question here.


Yes, a PF_INET6 socket can send to IPv4 destination addresses with sendto() - as long as you haven't bound it to an IPv6 local address, anyway.

0

精彩评论

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