Linux SO_REUSEADDR or SO_REUSEPORT

Scott Ware wsware at bellsouth.net
Mon Sep 22 05:46:05 PDT 2003


I was trying to use a Linux program the reused a port it listens on and it always failed to bind under FreeBSD. I stumbled accross this in Google: http://groups.google.com/groups?q=linux_so_reuseaddr&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=20020715.201656.104025700.take_tk.hm.rd.sanyo.co.jp%40ns.sol.net&rnum=1

So I changed:
/usr/src/sys/compat/linux/linux_socket.c : 145 
 case LINUX_SO_REUSEADDR:
  return (SO_REUSEADDR); 

to:
/usr/src/sys/compat/linux/linux_socket.c : 145 
 case LINUX_SO_REUSEADDR:
  return (SO_REUSEPORT); 

And the program now works! Is this bad Linux coding or a bug in the FreeBSD Linux emulation?

FreeBSD 4.8
linux_base-8-8.0_1




More information about the freebsd-emulation mailing list