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 Fri, Feb 08, 2019 at 05:19:40PM +0000, Roy Marples wrote:
> Hi List
>
> Whilst traking down a dhcpcd issue for Jared it occured to me that
> my use of IP_PKTINFO might not be ideal for NetBSD. Here's the
> scenario:
>
> interface a: 192.168.0.101/24
> interface b: 192.168.0.102/24
>
> The route to 192.168.0.255 belongs on interface a.
>
> If I send a UDP packet to 192.168.0.1 it will by default leave by
> interface a.
> My question is this - should IP_PKTINFO allow the same message to
> leave by interface b - ie effectively bypassing the routing table?
I think so, but I think that if you want to send a packet that both has
a particular source address and transmits on a particular interface,
IP_PKTINFO may not be adequate?
Many years ago I wanted to transmit (multicast) packets on multiple
interfaces. Each interface had a unique address 169.254.x.y/16
assigned. The source address of every packet had to match the
169.254.x.y address of the interface it was transmitted on. The
169.254.x.y address happened to be secondary on each interface. For one
reason or another, I used a different socket for each interface.
Dave
--
David Young
dyoung%pobox.com@localhost Urbana, IL (217) 721-9981
Home |
Main Index |
Thread Index |
Old Index