[Lunar-commits] <moonbase> dhcp: fixed ip6 on ip4 only machine If ip6 is removed from kernel to increase security dhcp will still try to use it. If ip6 is not present dhcp will fail to start. This fix autodetects ip4 only machines and compiles dhcp accordingly.

Zbigniew Luszpinski zbiggy at lunar-linux.org
Sun Jan 10 20:06:12 CET 2010


commit 95e54385deb093eebb770faef8088fec3f0350f1
Author: Zbigniew Luszpinski <zbiggy at lunar-linux.org>
Date:   Sun Jan 10 20:06:12 2010 +0100

    dhcp: fixed ip6 on ip4 only machine
    If ip6 is removed from kernel to increase security dhcp will still try to use it.
    If ip6 is not present dhcp will fail to start.
    This fix autodetects ip4 only machines and compiles dhcp accordingly.
---
 net/dhcp/BUILD |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/dhcp/BUILD b/net/dhcp/BUILD
index 70d7b30..53309cd 100644
--- a/net/dhcp/BUILD
+++ b/net/dhcp/BUILD
@@ -1,10 +1,14 @@
 (
-  CFLAGS+="-D_GNU_SOURCE"
+  CFLAGS+=" -D_GNU_SOURCE "
   MODHOME="$MOONBASE/net/$MODULE"
   CFGHOME="/etc/config.d"
   OPTS+=" --with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
           --with-cli-lease-file=/var/state/dhcp/dhclient.leases"
 
+  if [ ! -e /proc/net/if_inet6 ]; then
+  OPTS+=" --disable-dhcpv6 "
+  fi &&
+
   sedit 's;^dist_sysconf_DATA.*dhcpd.conf;dist_sysconf_DATA =;' server/Makefile.in &&
 
   default_build  &&


More information about the Lunar-commits mailing list