tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: IP_PKTINFO, sendmsg(2) and routing.



On 12/02/2019 17:39, David Young wrote:
On Tue, Feb 12, 2019 at 11:10:28AM +0000, Roy Marples wrote:
On 08/02/2019 22:50, Dennis Ferguson wrote:
It should send the packet out the IP_PKTINFO interface if packet is sent
with MSG_DONTROUTE/SO_DONTROUTE. If this isn’t working it should probably
be made to, routing protocols in general depend on being able to do that.

I don't see how the two are related.
Routing can still be obeyed to an extent.
Consider the following

Interface A has 192.168.0.1/24
Interface B has 192.168.0.2/24
The subnet 192.168/24 belongs to interface A
There is a default route to 192.168.0.10, again on interface A

If I sent a packet to 1.2.3.4 and IP_PKTINFO says use interface B I
would expect the packet to be sent to the default router of
192.168.0.10 but exit via interface B and not interface A.

If you don't use _DONTROUTE, then I would *hope* for the transmission to
fail with an error, probably EHOSTUNREACH, if 1.2.3.4 has no route on
interface B.  However, today I sort of *expect* for the transmission to
go out interface A, since the nexthop and its link-layer information are
on interface A.

So what benefit does IP_PKTINFO bring us for sending exactly?
Because you've just ruled out the use case I tried to illustrate here:
https://mail-index.netbsd.org/tech-net/2019/02/11/msg007254.html

Roy


Home | Main Index | Thread Index | Old Index