Subject: Re: Multicasting problems with NetBSD 1.6
To: None <tech-net@netbsd.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: tech-net
Date: 11/09/2003 13:25:52
--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

On Sun, Nov 09, 2003 at 12:04:07PM +0100, Andreas R=F8sdal wrote:

> a the multicast group:
> setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP ...)

Your code is working fine in this respect; the kernel sends the
appropriate IGMP join group/leave group notifications. But read on:
=20
> However, when this code is run on NetBSD, it doesn't join the multicast
> group. The code works for the all-hosts group (224.0.0.1), but not any
> other multicast group.

No, your code is not working at all...

a) for all sin_port assignments, you need to transform the port number to
network byte order by using htons() (.... =3D htons(15000)). Else you'll se=
nd
to port 38970 instead of 15000, if on a little-endian machine.

b) for the sender code, do NOT bind the socket to the multicast group. Else
the sending IP address will be the multicast address.

With both changes done, I do happily send lines of text back and forth
between NetBSD/arm32 and NetBSD/m68k.

Regards,
	-is
--=20
seal your e-mail: http://www.gnupg.org/

--2oS5YaxWCcQjTEyO
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (NetBSD)

iD4DBQE/rjJQPCRcZ/VMtk4RAmmBAJj5Sg3XJPkHax666Fri1DiUDk62AJ9m1+Fa
qxbT8QuLNWgRsESer8ByFA==
=BR50
-----END PGP SIGNATURE-----

--2oS5YaxWCcQjTEyO--