You might want to check UNIX Network Programming by W.R. Stevens, but IIRC if you don't bind() you default to 0.0.0.0 which matches anything. So conceptually, no matter what your interfaces are defined as, 0.0.0.0 will still match anything... Hope this helps, On Tue, Mar 22, 2005 at 05:51:15PM +0000, Filipe Abrantes wrote: > Hi all, > > I have one doubt regarding binding sockets to IP addresses: > > When I don't bind an UDP socket to a specific local IP address, > that socket may receive packets from any interface. But imagine that one IP > address of one of my local interfaces changes, will I be able to > continue receiveing packets from that interface using the previous > socket? What does the kernel do when I create a socket without binding > it to a local IP address, does it bind it to all my IP's at the time the > socket was created? > > Best Regards > > Filipe > > -- > Filipe Lameiro Abrantes > INESC Porto > Campus da FEUP > Rua Dr. Roberto Frias, 378 > 4200-465 Porto > Portugal > > Phone: +351 22 209 4266 > E-mail: fla@xxxxxxxxxxxxx > - > : 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 -- Martijn van Oosterhout <kleptog@xxxxxxxxx> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
Attachment:
pgpHLJdUkBNE2.pgp
Description: PGP signature