Subject: Problem resolved - Incorrect source address on multicast packets on multihomed machines?

From: Phil Irey <[email-masked]>
Date: Tue, 7 Jul 1998 16:20:56 -0400 (EDT)

All,

A solution to the multicast problem I was having on Solaris machines
has been found.  An engineer within Sun (not Sun tech support) 
provided me with the following email:

   I think i've found the bug. There is also a workaround. If you
   do a bind() to pref_in_addr before connect(), the src addr will
   be the one you want.

To summarize, I was using connect()/send() calls and forgot to do the
bind() before the connect(). Doh!

Three factors (or excuses) which contributed to me not noticing this
were: 

1) Sun tech support said that "multicast is supposed to work this
way.  The source address is a node address (e.g. the IP address of the 
ethernet interface), not necessarily the address of the interface from
which the packet was sourced."  He said that he confirmed this with
engineering and that was the way it was supposed to work.  He could
not explain why it changed after the first packet, however, but did
feel that this was legal.  1 1/2 weeks later sun tech support provided 
an answer nearly identical to the one above.

2) Given sufficient settling time or after a reboot, the first packet
had the correct source IP address and was sent on the proper
interface.  All subsequent packets had the address of the ethernet
interface regardless of the interface on which the packet was
sent. (Since the first packet was correct in every way, I thought I
was properly binding).

3) The code ran just fine on SGI boxes without the bind().

thanks for all the responses,

phil