Solved isc-dhcp44-server port lacking --enable-use-sockets configure option

Greetings. I look forward to use net/isc-dhcp44-server to answer to DHCP relays. It is a bit unusual configuration, where relay runs on the same machine (because it does a bit more than just relaying DHCP packets), therefore have to address the DHCP server by an IP address, using sockets. The default port build binds using BPF and cannot answer to such kind of requests. In order to do so, the port have to be configured with --enable-use-sockets. However there is no toggle to do so in the port's Makefile.

So far I've added CONFIGURE_ARGS+=--enable-use-sockets to the Makefile and that suits me fine. But, in the long term, I suspect this is not the right thing to do. Can anyone suggest what is the proper way for me to move forward? I prefer to avoid modifying files in the /usr/ports tree. I can copy /usr/ports/net/isc-dhcp44-server out of /usr/ports tree and do local modifications on Makefile. The drawback is I will detach from port updates. Do I have other options?

Thanks in advance!
 
Submit a request on https://bugs.freebsd.org to add it to the port. Maybe you can even come up with a patch that adds a new port option for this.

Other than that create /usr/ports/net/isc-dhcp44-server/Makefile.local (which as the name implies is local to your machine only and will not be overwritten when you update the ports tree) and add CONFIGURE_ARGS+=--enable-use-sockets there to avoid modifying the Makefile directly in the meantime.
 
Enclosing Makefile.local for convenience:
Makefile:
# -*- Makefile -*-
OPTIONS_DEFINE:= $(OPTIONS_DEFINE) SOCKETS
SOCKETS_DESC=    use the standard BSD socket API
SOCKETS_CONFIGURE_ENABLE=    use-sockets
 
Why just not write to the /etc/make.conf, which is local for any machine and must be copied (from admin's archive) on installing each next server, something like this:
Code:
.if ( ${.CURDIR:M*/net/isc-dhcp44-*} )
  CONFIGURE_ARGS+=    --enable-use-sockets
.endif
?
But it did not work in my case %(ISC-DHClient-4.4.2)
I just get "send_packet: Network is unreachable" and "dhclient.c:2456: Failed to send 300 Byte long packet over … interface".
 
Back
Top