dhcpd-4.2.2 maxsocks problem

Jeff Waller jeffw at cnxntech.com
Thu Jan 12 15:38:58 UTC 2012

Without looking into the code too much I found the following comment in socket.c (see below):  Which I think
means yea you can change the kernel to allow more file descriptors but you will run into problems
trying to increase beyond either 4096 or FD_SETSIZE whichever is applicable depending on how
the server was compiled.   It appears you can change that number maybe and re-compile but 
be wary. 

Here's what FD_SETSIZE is set to in linux:

./linux/posix_types.h:#define __FD_SETSIZE	1024

Couple of things to try.

1)  First off, what is that number?  Is it 1024 or is it 4096?  Use gdb to find out where this is hitting the error.
It maybe be as simple as gdb dhcpd core (modify to actual filenames if not all in the same 

2)  Get 4.2.3  (4.2.2 is 6 months old).  I would have thought that you can simply download the
source and compile, it doesn't compile on BSD??  If you're going to modify, you're going to need
the source anyway.  And figure out a way to not use SELECT there is definitely support for
this in configure but it looks like kqueue on by default; make sure.  BTW this is all bind stuff which
dhcp depends on 

./configure --help 


  --enable-kqueue         use BSD kqueue when available [default=yes]
  --enable-epoll          use Linux epoll when available [default=auto]
  --enable-devpoll        use /dev/poll when available [default=yes]


 * Maximum number of allowable open sockets.  This is also the maximum
 * allowable socket file descriptor.
 * Care should be taken before modifying this value for select():
 * The API standard doesn't ensure select() accept more than (the system default
 * of) FD_SETSIZE descriptors, and the default size should in fact be fine in
 * the vast majority of cases.  This constant should therefore be increased only
 * when absolutely necessary and possible, i.e., the server is exhausting all
 * available file descriptors (up to FD_SETSIZE) and the select() function
 * and FD_xxx macros support larger values than FD_SETSIZE (which may not
 * always by true, but we keep using some of them to ensure as much
 * portability as possible).  Note also that overall server performance
 * may be rather worsened with a larger value of this constant due to
 * inherent scalability problems of select().
 * As a special note, this value shouldn't have to be touched if
 * this is a build for an authoritative only DNS server.
#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL)
#elif defined(USE_SELECT)
#endif  /* USE_KQUEUE... */

On Jan 12, 2012, at 8:51 AM, Jan Markus wrote:

> Hello,
> we have isc-dhcpd 4.2.2 from ports on FreeBSD 8.2. We have cca 1050 Vlan interfaces:
> ifconfig vlan1234 create inet vlan 1234 vlandev igb1
> and the same number of dhcpd declarations like this:
> shared-network vlan1234 {
>     subnet netmask {
>         range;
>         option routers;
>     }
> }
> But our DHCP server refuses to start, saying:
> ../../../../lib/isc/unix/socket.c:958: INSIST(fd >= 0 && fd < (int)manager->maxsocks) failed, back trace
> #0 0x52a5ca in ??
> #1 0x52a77a in ??
> #2 0x54768b in ??
> #3 0x548f63 in ??
> #4 0x46fc80 in ??
> #5 0x445cfb in ??
> #6 0x40de69 in ??
> #7 0x40c38e in ??
> #8 0x8006bc000 in ??
> Abort trap (core dumped)
> /usr/local/etc/rc.d/isc-dhcpd: WARNING: failed to start dhcpd
> My kernel sockets limits are:
> # sysctl -a | grep soc
> kern.ipc.maxsockbuf: 16777216
> kern.ipc.maxsockets: 204800
> kern.ipc.numopensockets: 17
> net.inet.ip.mcast.maxsocksrc: 128
> Please, what should I do?
> Thank you very much for your time.
> -Jan
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users

More information about the dhcp-users mailing list