dd84686325
This version of dhcrelay(8) needed to stay inforeground with -d flag in order to service requests. Running inbackground turned it deaf to DHCP requests. This was caused by wrong kqueue(2) usage, where kevent(2) was used with a file descriptor obtained by a kqueue(2) call done before fork(2). kqueue(2) man page says "The queue is not inherited by a child created with fork(2)". As a result, kevent(2) calls always got EBADF. The fix is to reorder function calls in dhcrelay(8) main() function. dhcp_context_create(), which causes kqueue(2) to be invoked, is moved with its dependencies after fork(2). This matches the code layout of dhclient(8) and dhcpd(8), which do not have the bug. The fix was not submitted upstream since latest ISC DHCP code was refactored and does not have the bug anymore. |
||
---|---|---|
bin | ||
common | ||
compat | ||
crypto | ||
dist/pf | ||
distrib | ||
doc | ||
etc | ||
external | ||
extsrc | ||
games | ||
include | ||
lib | ||
libexec | ||
regress | ||
rescue | ||
sbin | ||
share | ||
sys | ||
tests | ||
tools | ||
usr.bin | ||
usr.sbin | ||
build.sh | ||
BUILDING | ||
Makefile | ||
Makefile.inc | ||
UPDATING |