Re: SO_REUSEPORT and multicasting

From: Jason
Date: Wed Jun 14 2006 - 13:56:44 EST


--- Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
> Linux follows the standards draft. SO_REUSEPORT is
> a fairly obscure BSDism.

Standards are good. I like standards. I was not
aware that SO_REUSEPORT was that obscure. My
programming instructor made it sound like every OS
supports it. I guess he was wrong. Is there a Linux
equivalent to SO_REUSEPORT?

> > Yes. My code works great on HP-UX but does
> > nothing on Linux.
>
> That doesn't actually prove very much. Its very easy
> to write incorrect
> code that only works on one system, especially when
> endian-ness gets
> involved with network code.

I have written other unicast programs on Linux and
sftp'd them to HP-UX, compiled, and they ran great.
The only change I have to make between Linux and HP-UX
is in the Makefile. I have change the following line:
INCS= -I. -include /usr/include/errno.h #to use fedora

I comment out the -include on the HP-UX and everything
is great.

This multicast application was based on its TCP
brother. The only difference is removing TCP and
installing multicast support.

> In particular if writing portable code you must
> remember to join the
> group. You must also remember that the various
> htons/htonl macros need
> to be correctly used or your code will break on
> little-endian systems.

All of those macros are used in the multicast.c file I
was given.

> The default IP_MULTICAST_LOOP value is probably also
> worth overriding if
> you are being fairly paranoid.

The wrapper I used has a function to set the TTL and
the loop values. I set the TTL to 3 and the loop to
0.

Thanks,



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/