Re: multihomed hosts and UDP source address

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

 



Let me explain some more.  

If you want all interfaces, Linux provides a way to use a single socket,
and still manage the source addresses: IP_PKTINFO.   Then interface
addition/deletion does not involve userspace.  This is currently not
used by most software (bind9, ntpd, heimdal-kdc) however, so they use
the older approach used on other unix, to bind one socket per interface.

The problem is, when binding to a specific interface, you have to track
interface addition/deletion.  Some approaches are better than others,
but restarting the process or waiting for it to poll an interface, are
not ideal.

For the above case, using a single socket with IP_PKTINFO, eliminates
the need to track interface add/remove/address change, correct?

Now the other use case, listening only on certain interfaces, maybe the
features don't overlap (automatic interface add/remove vs selective
interface listen), and the best that can be done using the socket API is
for userspace to drop the packet, or use iptables to send the ICMP Port
Unreachable... both less than ideal.

Is there a 3rd option?

Jeremy

If you want to bind to only certain interfaces, 

On Tue, 2007-11-20 at 14:07 +0800, Herbert Xu wrote:
> Jeremy Jackson <jerj@xxxxxxxxxxxx> wrote:
> >
> > Is there a solution that lets a single socket "not-bind" to certain
> > interfaces?
> 
> By binding it to a specific interface?
> 
> Cheers,
-- 
Jeremy Jackson
Coplanar Networks
(519)489-4903

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux