diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-12-30 17:54:08 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-12-30 17:54:08 +0000 |
commit | 1dbb807ff87988c20b8f4e4216d431742d918a63 (patch) | |
tree | 8a3fb2295f4f25d48d1ba4a5396a9b0dcb481b3c /usr.sbin/dhcp | |
parent | f6c242ed606c57d83c3caab002b7e1a99cb96c1c (diff) |
setockopt(SO_REUSEPORT), so multiple dhclients work, PR 1391
Diffstat (limited to 'usr.sbin/dhcp')
-rw-r--r-- | usr.sbin/dhcp/common/socket.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/dhcp/common/socket.c b/usr.sbin/dhcp/common/socket.c index c8d086be479..2f19de70bd1 100644 --- a/usr.sbin/dhcp/common/socket.c +++ b/usr.sbin/dhcp/common/socket.c @@ -50,7 +50,7 @@ #ifndef lint static char copyright[] = -"$Id: socket.c,v 1.1 1998/08/18 03:43:27 deraadt Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: socket.c,v 1.2 2000/12/30 17:54:07 angelos Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -127,6 +127,11 @@ int if_register_socket (info) (char *)&flag, sizeof flag) < 0) error ("Can't set SO_REUSEADDR option on dhcp socket: %m"); + flag = 1; + if (setsockopt (sock, SOL_SOCKET, SO_REUSEPORT, + (char *)&flag, sizeof flag) < 0) + error ("Can't set SO_REUSEPORT option on dhcp socket: %m"); + /* Set the BROADCAST option so that we can broadcast DHCP responses. */ if (setsockopt (sock, SOL_SOCKET, SO_BROADCAST, (char *)&flag, sizeof flag) < 0) |