Ryo Shimizu
2017-07-25 05:53:44 UTC
Hi,
I implemented IP_PKTINFO for sendmsg(2). For recvmsg(2) IP_PKTINFO is already
supported, but it is not supported for sending. This causes problems
described in https://mail-index.netbsd.org/tech-net/2013/09/22/msg004252.html
patch is here.
http://www.netbsd.org/~ryo/ip_pktinfo.patch
or https://github.com/ryo/netbsd-src/compare/master...ip_pktinfo
summary of patch:
- udp_output()
- process IP_PKTINFO in cmsg
- specified ip_pktinfo->ipi_addr, check the address is bindable, and use it.
- specified ip_pktinfo->ipi_ifindex, pick up an address from the interface,
and IP_ROUTETOIFINDEX flag and imo.imo_multicast_if_index are passed to
ip_output() to output from the interface. Multicast already has similar
function, therefore I used ip_moptions argument for specifying ifindex.
- rip_output()
- just about same as udp_output() except checking pcb.
- ip_output()
- if IP_ROUTETOIFINDEX is set, checking that whether packets can be output
from the specified interface. loopback, p2p interface, or direct address
are ok. Otherwise, checking that the destination address has a gateway
address on the interface.
any comment? or ok to commit?
Thanks,
--
ryo shimiz
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
I implemented IP_PKTINFO for sendmsg(2). For recvmsg(2) IP_PKTINFO is already
supported, but it is not supported for sending. This causes problems
described in https://mail-index.netbsd.org/tech-net/2013/09/22/msg004252.html
patch is here.
http://www.netbsd.org/~ryo/ip_pktinfo.patch
or https://github.com/ryo/netbsd-src/compare/master...ip_pktinfo
summary of patch:
- udp_output()
- process IP_PKTINFO in cmsg
- specified ip_pktinfo->ipi_addr, check the address is bindable, and use it.
- specified ip_pktinfo->ipi_ifindex, pick up an address from the interface,
and IP_ROUTETOIFINDEX flag and imo.imo_multicast_if_index are passed to
ip_output() to output from the interface. Multicast already has similar
function, therefore I used ip_moptions argument for specifying ifindex.
- rip_output()
- just about same as udp_output() except checking pcb.
- ip_output()
- if IP_ROUTETOIFINDEX is set, checking that whether packets can be output
from the specified interface. loopback, p2p interface, or direct address
are ok. Otherwise, checking that the destination address has a gateway
address on the interface.
any comment? or ok to commit?
Thanks,
--
ryo shimiz
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de