[comp.protocols.tcp-ip] Questions about 4.3BSD bind

zwang@CS.UCL.AC.UK (Zheng Wang, Ext: 3701) (01/12/89)

 >If I bind a socket with the internet address of INADDR_ANY, which
 >internet address is returned?  Which internet address is placed in the
 >source address part of the IP header/trailer sent on that socket?
 >kernel determine which one I get?

Unfortunately, the internet address seems to be chosen at
random. Both addresses are possible.

 >Does the kernel keep separate UDP and TCP
 >port tables for each internet address?

No, the port can receive messages from both addresses.

Zheng

louie@TRANTOR.UMD.EDU ("Louis A. Mamakos") (01/13/89)

 >If I bind a socket with the internet address of INADDR_ANY, which
 >internet address is returned?  Which internet address is placed in the
 >source address part of the IP header/trailer sent on that socket?
 >kernel determine which one I get?

The internet address, unless specifically bound, is assigned based on the
address of the interface that the packets will be sent through.  The 
interface is selected based on the routing table.


Louis A. Mamakos  WA3YMH    Internet: louie@TRANTOR.UMD.EDU
University of Maryland, Computer Science Center - Systems Programming