Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

linux's SO_REUSEADDR is BSD's SO_REUSEPORT

6 views
Skip to first unread message

ta...@tk.hm.rd.sanyo.co.jp

unread,
Jul 15, 2002, 7:17:14 AM7/15/02
to

Hello,
Recently I had a problem with linux emulation.

I used linux-jdk13. When I ran one network programming,
it didn't work. So I searched the reason (because in Linux
it worked), and found that among below source code.

In FreeBSD CURRENT-5.0
/usr/src/sys/compat/linux/linux_socket.c : 145
case LINUX_SO_REUSEADDR:
return (SO_REUSEADDR);

These are man-pages of socket option in Linux and FreeBSD.

Linux :
> man 7 socket
...
SO_REUSEADDR
Indicates that the rules used in validating addresses supplied in a
bind(2) call should allow reuse of local addresses. For PF_INET sockets
this means that a socket may bind, except when there is an active
listening socket bound to the address. When the listening socket is bound
to INADDR_ANY with a specific port then it is not possible to bind to
this port for any local address.

FreeBSD :
> man getsockopt
...
SO_REUSEADDR enables local address reuse
SO_REUSEPORT enables duplicate address and port bindings


When I changed SO_REUSEADDR into SO_REUSEPORT, it finally worked!
Is this problem already known ? I couldn't find.

regards,

---
Satoru Takeuchi / ta...@tk.hm.rd.sanyo.co.jp
Sanyo R&D Digital System Research Center

To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message

0 new messages