Date: Mon, 15 Jul 2002 20:16:56 +0900 (JST) From: Satoru Takeuchi <take@tk.hm.rd.sanyo.co.jp> To: emulation@FreeBSD.ORG Cc: take@tk.hm.rd.sanyo.co.jp Subject: linux's SO_REUSEADDR is BSD's SO_REUSEPORT Message-ID: <20020715.201656.104025700.take@tk.hm.rd.sanyo.co.jp>
next in thread | raw e-mail | index | archive | help
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 / take@tk.hm.rd.sanyo.co.jp
Sanyo R&D Digital System Research Center
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020715.201656.104025700.take>
