diff --git a/README.md b/README.md index 7a554c8..850eb46 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # dhcp +DHCP (Dynamic Host Configuration Protocol) is a protocol which allows individual devices on an IP network to get their own network configuration information (IP address, subnetmask, broadcast address, etc.) from a DHCP server. +The overall purpose of DHCP is to make it easier to administer a large network. + +This package contains the DHCP server and a DHCP relay agent. + diff --git a/dhcp-3.0.1-dhclient-script-nodomain.patch b/dhcp-3.0.1-dhclient-script-nodomain.patch new file mode 100644 index 0000000..4448e57 --- /dev/null +++ b/dhcp-3.0.1-dhclient-script-nodomain.patch @@ -0,0 +1,26 @@ +diff -Nru dhcp-3.0.1.orig/client/scripts/linux dhcp-3.0.1/client/scripts/linux +--- dhcp-3.0.1.orig/client/scripts/linux 2005-05-02 10:08:12.000000000 +0200 ++++ dhcp-3.0.1/client/scripts/linux 2005-05-02 10:08:39.000000000 +0200 +@@ -23,12 +23,16 @@ + # of the $1 in its args. + + make_resolv_conf() { +- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then +- echo search $new_domain_name >/etc/resolv.conf +- chmod 644 /etc/resolv.conf +- for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >>/etc/resolv.conf +- done ++ if [ x"$new_domain_name_servers" != x ]; then ++ if [ "x$new_domain_name" != x ]; then ++ echo search $new_domain_name >/etc/resolv.conf ++ else ++ > /etc/resolv.conf ++ fi ++ chmod 644 /etc/resolv.conf ++ for nameserver in $new_domain_name_servers; do ++ echo nameserver $nameserver >>/etc/resolv.conf ++ done + fi + } + diff --git a/dhcp-3.0.2-dhclient-log-less-annoying.patch b/dhcp-3.0.2-dhclient-log-less-annoying.patch new file mode 100644 index 0000000..6cbe20b --- /dev/null +++ b/dhcp-3.0.2-dhclient-log-less-annoying.patch @@ -0,0 +1,30 @@ +diff -Nru dhcp-3.0.2.orig/client/dhclient.c dhcp-3.0.2/client/dhclient.c +--- dhcp-3.0.2.orig/client/dhclient.c 2005-05-02 12:39:35.000000000 +0200 ++++ dhcp-3.0.2/client/dhclient.c 2005-05-02 12:41:48.000000000 +0200 +@@ -1436,7 +1436,7 @@ + client -> packet.secs = htons (65535); + client -> secs = client -> packet.secs; + +- log_info ("DHCPDISCOVER on %s to %s port %d interval %ld", ++ log_debug ("DHCPDISCOVER on %s to %s port %d interval %ld", + client -> name ? client -> name : client -> interface -> name, + inet_ntoa (sockaddr_broadcast.sin_addr), + ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval)); +@@ -1466,7 +1466,7 @@ + + loop = lp = client -> active; + +- log_info ("No DHCPOFFERS received."); ++ log_debug ("No DHCPOFFERS received."); + + /* We may not have an active lease, but we may have some + predefined leases that we can try. */ +@@ -1547,7 +1547,7 @@ + exit (2); + } + +- log_info ("No working leases in persistent database - sleeping."); ++ log_debug ("No working leases in persistent database - sleeping."); + script_init (client, "FAIL", (struct string_list *)0); + if (client -> alias) + script_write_params (client, "alias_", client -> alias); diff --git a/dhcp-4.0.0-dhclient-script-chk4lock.patch b/dhcp-4.0.0-dhclient-script-chk4lock.patch new file mode 100644 index 0000000..ac67a6d --- /dev/null +++ b/dhcp-4.0.0-dhclient-script-chk4lock.patch @@ -0,0 +1,25 @@ +diff -Nru dhcp-4.0.0.orig/client/scripts/linux dhcp-4.0.0/client/scripts/linux +--- dhcp-4.0.0.orig/client/scripts/linux 2007-06-07 00:57:32.000000000 +0200 ++++ dhcp-4.0.0/client/scripts/linux 2008-07-03 10:12:37.000000000 +0200 +@@ -27,7 +27,11 @@ + + make_resolv_conf() { + if [ x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient ++ LOCKLINE=`grep -m1 "^; lock [0-9]\+" /etc/resolv.conf 2>/dev/null` ++ if [ "$LOCKLINE" ] ; then ++ [ -e /proc/${LOCKLINE##; lock } ] && return ++ fi ++ echo "; generated by /sbin/dhclient-script" > /etc/resolv.conf.dhclient + chmod 644 /etc/resolv.conf.dhclient + if [ x"$new_domain_search" != x ]; then + echo search $new_domain_search >> /etc/resolv.conf.dhclient +@@ -43,7 +47,7 @@ + + mv /etc/resolv.conf.dhclient /etc/resolv.conf + elif [ "x${new_dhcp6_name_servers}" != x ] ; then +- cat /dev/null > /etc/resolv.conf.dhclient6 ++ echo "; generated by /sbin/dhclient-script" > /etc/resolv.conf.dhclient6 + chmod 644 /etc/resolv.conf.dhclient6 + + if [ "x${new_dhcp6_domain_search}" != x ] ; then diff --git a/dhcp-4.0.0-dhclient-script-setpath.patch b/dhcp-4.0.0-dhclient-script-setpath.patch new file mode 100644 index 0000000..a68f6ac --- /dev/null +++ b/dhcp-4.0.0-dhclient-script-setpath.patch @@ -0,0 +1,11 @@ +diff -Nru dhcp-4.0.0.orig/client/scripts/linux dhcp-4.0.0/client/scripts/linux +--- dhcp-4.0.0.orig/client/scripts/linux 2008-07-03 11:29:25.000000000 +0200 ++++ dhcp-4.0.0/client/scripts/linux 2008-07-03 11:30:10.000000000 +0200 +@@ -23,6 +23,7 @@ + # of the $1 in its args. + + # 'ip' just looks too weird. /sbin/ip looks less weird. ++PATH=/sbin:/usr/sbin:/bin:/usr/bin + ip=/sbin/ip + + make_resolv_conf() { diff --git a/dhcp-4.1.0-ping_from_if.patch b/dhcp-4.1.0-ping_from_if.patch new file mode 100644 index 0000000..1f4074d --- /dev/null +++ b/dhcp-4.1.0-ping_from_if.patch @@ -0,0 +1,12 @@ +diff -Nru dhcp-4.1.0.orig/client/scripts/linux dhcp-4.1.0/client/scripts/linux +--- dhcp-4.1.0.orig/client/scripts/linux 2009-01-17 15:15:09.000000000 +0100 ++++ dhcp-4.1.0/client/scripts/linux 2009-01-17 15:16:15.000000000 +0100 +@@ -211,7 +211,7 @@ + ifconfig $interface inet $new_ip_address $new_subnet_arg \ + $new_broadcast_arg + set $new_routers +- if ping -q -c 1 $1; then ++ if ping -q -c 1 -I $interface $1; then + if [ x$new_ip_address != x$alias_ip_address ] && \ + [ x$alias_ip_address != x ]; then + ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg diff --git a/dhcp-Makefile.conf b/dhcp-Makefile.conf new file mode 100644 index 0000000..a4aab94 --- /dev/null +++ b/dhcp-Makefile.conf @@ -0,0 +1,499 @@ +# Makefile.conf +# +# Copyright (c) 1996-2000 Internet Software Consortium. +# Use is subject to license terms which appear in the file named +# ISC-LICENSE that should have accompanied this file when you +# received it. If a file named ISC-LICENSE did not accompany this +# file, or you are not sure the one you have is correct, you may +# obtain an applicable copy of the license at: +# +# http://www.isc.org/isc-license-1.0.html. +# +# This file is part of the ISC DHCP distribution. The documentation +# associated with this file is listed in the file DOCUMENTATION, +# included in the top-level directory of this release. +# +# Support and other services are available for ISC products - see +# http://www.isc.org for more information. +# + +## Defaults... +SCRIPT = none +USERBINDIR = /usr/bin +BINDIR = /usr/sbin +CLIENTBINDIR = /sbin +ADMMANDIR = /usr/share/man/man8 +ADMMANEXT = .0 +FFMANDIR = /usr/share/man/man5 +FFMANEXT = .0 +LIBMANDIR = /usr/share/man/man3 +LIBMANEXT = .0 +USRMANDIR = /usr/share/man/man1 +USRMANEXT = .0 +MANCAT = cat +INSTALL = install -c -m 444 +MANINSTALL = install -c +CHMOD = chmod +CATMANPAGES = +ETC = /etc +VARRUN = /var/run/dhcp +VARDB = /var/lib/dhcp +LIBDIR=/usr/lib +INCDIR=/usr/include +LIBS = +COPTS = $(BINDDEF) $(CC_OPTIONS) +DEBUG = -g +RANLIB = ranlib +MKDEP = mkdep +CLIENT_PATH = '"PATH=/usr/bin:/usr/sbin:/bin:/sbin"' + +BINDLIB = ../minires/libres.a +BINDINC = +MINIRES = minires + +# Major version number (if applicable) +##--majver-- +MAJORVERSION=MajorVersion +##--majver-- + +# Minor version number (if applicable) +##--minver-- +MINORVERSION=MinorVersion +##--minver-- + +## Porting:: +# +# For each supported operating system, there is a block of text below +# beginning with #--os-name-- and ending with #--os-name--. Between +# these delimiters are assignments, commented out, which define the +# Makefile variables required for that operating system. +# +# The configure shell script figures out what operating system it's +# being run on and then runs Makefile.dist through a sed script which +# removes the comment characters from the appropriate set of +# assignments, and writes the output to Makefile. + +## AIX 4.3 +##--aix-- +#CF = cf/aix.h +#CC=cc -Daix +#INSTALL=/usr/ucb/install -c +#MANINSTALL=/usr/ucb/install -c -m 444 +#ADMMANEXT = .8 +#FFMANEXT = .5 +#VARRUN = /etc +#VARDB = /etc +##--aix-- + +## NEXTSTEP 3.x,4.x +##--nextstep-- +#CF = cf/nextstep.h +#CC=cc +#COPTS = -Wall $(BINDDEF) $(CC_OPTIONS) +#BINDIR=/usr/etc +#ADMMANDIR = /usr/local/man/cat8 +#FFMANDIR = /usr/local/man/cat5 +#LIBMANDIR = /usr/local/man/cat3 +#USRMANDIR = /usr/local/man/cat1 +#ADMMANEXT = .8 +#FFMANEXT = .5 +#LIBMANEXT = .3 +#USRMANEXT = .3 +#VARRUN = /etc +#VARDB = /etc +##--nextstep-- + +## SunOS 4.1 +##--sunos4-- +#CC = gcc +#LIBS = -lresolv +#CF = cf/sunos4.h +#BINDIR=/usr/etc +#CLIENTBINDIR=/etc +#ADMMANEXT = .8 +#FFMANEXT = .5 +#VARRUN = /etc +#VARDB = /etc +##--sunos4-- + +## Solaris 2.5 (with gcc) +##--sunos5-gcc-- +#INSTALL=/usr/ucb/install +#MANINSTALL=/usr/ucb/install +#LIBS = -lresolv -lsocket -lnsl -lgen +#CC=gcc +#COPTS = $(BINDDEF) -Wall -Wno-unused -Wno-implicit -Wno-comment \ +# -Wno-uninitialized -Wno-char-subscripts -Wno-switch -Werror \ +# -DSOLARIS_MAJOR=$(MAJORVERSION) -DSOLARIS_MINOR=$(MINORVERSION) \ +# $(CC_OPTIONS) +#CF = cf/sunos5-5.h +#ADMMANDIR = /usr/share/man/man1m +#ADMMANEXT = .1m +#FFMANDIR = /usr/share/man/man4 +#FFMANEXT = .4 +#LIBMANDIR = /usr/share/man/man3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/share/man/man1 +#USRMANEXT = .1 +#MANCAT = man +#VARRUN = /etc +#VARDB = /etc +#SCRIPT=solaris +##--sunos5-gcc-- + +## Solaris 2.5 (with Sun cc) +##--sunos5-cc-- +#INSTALL=/usr/ucb/install +#MANINSTALL=/usr/ucb/install +#LIBS = -lresolv -lsocket -lnsl -lgen +#CC=cc +#COPTS = -D__svr4__ $(BINDDEF) -erroff=E_END_OF_LOOP_CODE_NOT_REACHED \ +# -DSOLARIS_MAJOR=$(MAJORVERSION) -DSOLARIS_MINOR=$(MINORVERSION) \ +# $(CC_OPTIONS) +#CF = cf/sunos5-5.h +#ADMMANDIR = /usr/share/man/man1m +#ADMMANEXT = .1m +#FFMANDIR = /usr/share/man/man4 +#FFMANEXT = .4 +#LIBMANDIR = /usr/share/man/man3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/share/man/man1 +#USRMANEXT = .1 +#MANCAT = man +#VARRUN = /etc +#VARDB = /etc +#SCRIPT=solaris +##--sunos5-cc-- + +## DEC Alpha/OSF1 +##--alphaosf-- +#COPTS = -std $(CC_OPTIONS) +#INSTALL=/usr/ucb/installbsd -c +#MANINSTALL=/usr/ucb/installbsd -c +#CF = cf/alphaosf.h +#ADMMANEXT = .8 +#FFMANEXT = .5 +#VARDB = /etc +##--alphaosf-- + +## BSD/OS 2.1 through 4.0 +##--bsdos-- +#LIBS = -lresolv +#CC=gcc2 +#CF = cf/bsdos.h +#SCRIPT=bsdos +##--bsdos-- + +## BSD/OS 4.1 and higher. +##--bsdos-4.1-- +#CF = cf/bsdos.h +#SCRIPT=bsdos +##--bsdos-4.1-- + +## OpenBSD +##--openbsd-- +#CF = cf/openbsd.h +#SCRIPT=openbsd +##--openbsd-- + +## FreeBSD +##--freebsd-- +#CF = cf/freebsd.h +#SCRIPT=freebsd +##--freebsd-- + +## Rhapsody +##--rhapsody-- +#CF = cf/rhapsody.h +#COPTS = -Wall -Wno-unused -Wno-implicit -Wno-comment \ +# -Wno-uninitialized -Wno-switch -Werror -pipe $(BINDDEF) $(CC_OPTIONS) +##SCRIPT=rhapsody +##--rhapsody-- + +## Darwin/MacOSX +##--darwin-- +#CF = cf/rhapsody.h +#COPTS = -Ddarwin -Wall -Wno-unused -Wno-implicit -Wno-comment \ +# -Wno-uninitialized -Wno-switch -Werror -pipe $(BINDDEF) $(CC_OPTIONS) +##SCRIPT=rhapsody +##--darwin-- + +## NetBSD +##--netbsd-- +#CF = cf/netbsd.h +#COPTS = -Wall -Wstrict-prototypes -Wno-unused -Wno-comment \ +# -Wno-uninitialized -Werror \ +# -Wimplicit-function-declaration -Wpointer-arith -Wcast-qual \ +# -Wcast-align -Wwrite-strings -Wconversion -Wmissing-prototypes \ +# -Wmissing-declarations -Wnested-externs \ +# -pipe $(BINDDEF) $(CC_OPTIONS) +#SCRIPT=netbsd +##MKDEP=makedepend +##--netbsd-- + +## NetBSD nocast +## Some versions of the arm32 gcc have a problem in cast conversions. +## The Alpha definitely has a problem - if you pass '6' where a size_t +## is expected, you get a warning. So on these architectures, we do +## not ask for that sort of warning. +##--netbsd-nocast-- +#CF = cf/netbsd.h +#COPTS = -Wall -Wstrict-prototypes -Wno-unused -Wno-comment \ +# -Wno-uninitialized -Werror \ +# -Wimplicit-function-declaration -Wpointer-arith -Wcast-qual \ +# -Wwrite-strings -Wmissing-prototypes \ +# -Wmissing-declarations -Wnested-externs \ +# -pipe $(BINDDEF) $(CC_OPTIONS) +#SCRIPT=netbsd +##--netbsd-nocast-- + +## Ultrix +##--ultrix-- +#BINDIR = /usr/etc +#CLIENTBINDIR=/etc +#VARRUN = /etc +#VARDB = /etc +#CF = cf/ultrix.h +#ADMMANDIR = /usr/man/man8 +#ADMMANEXT = .8 +#FFMANDIR = /usr/man/man5 +#FFMANEXT = .5 +#LIBMANDIR = /usr/man/cat3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/man/cat1 +#USRMANEXT = .1 +##--ultrix-- + +## Linux 1.x +##--linux-1-- +#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) \ +# $(BINDDEF) $(CC_OPTIONS) +#CF = cf/linux.h +#ADMMANDIR = /usr/share/man/man8 +#ADMMANEXT = .8 +#FFMANDIR = /usr/share/man/man5 +#FFMANEXT = .5 +#LIBMANDIR = /usr/share/man/man3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/share/man/man1 +#USRMANEXT = .1 +#MANCAT = man +#VARRUN = /var/run/dhcp +#VARDB = /var/lib/dhcp +#SCRIPT=linux +##--linux-1-- + +## Linux 2.0 +##--linux-2.0-- +#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) \ +# $(BINDDEF) $(CC_OPTIONS) +#CF = cf/linux.h +#ADMMANDIR = /usr/share/man/man8 +#ADMMANEXT = .8 +#FFMANDIR = /usr/share/man/man5 +#FFMANEXT = .5 +#LIBMANDIR = /usr/share/man/man3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/share/man/man1 +#USRMANEXT = .1 +#MANCAT = man +#VARRUN = /var/run/dhcp +#VARDB = /var/lib/dhcp +#SCRIPT=linux +##--linux-2.0-- + +## Linux 2.1 +##--linux-2.1-- +#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) \ +# $(BINDDEF) $(CC_OPTIONS) +#CF = cf/linux.h +#ADMMANDIR = /usr/share/man/man8 +#ADMMANEXT = .8 +#FFMANDIR = /usr/share/man/man5 +#FFMANEXT = .5 +#LIBMANDIR = /usr/share/man/man3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/share/man/man1 +#USRMANEXT = .1 +#MANCAT = man +#VARRUN = /var/run/dhcp +#VARDB = /var/lib/dhcp +#SCRIPT=linux +##--linux-2.1-- + +## Linux 2.2 +##--linux-2.2-- +#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) \ +# $(BINDDEF) $(CC_OPTIONS) +#CF = cf/linux.h +#ADMMANDIR = /usr/share/man/man8 +#ADMMANEXT = .8 +#FFMANDIR = /usr/share/man/man5 +#FFMANEXT = .5 +#LIBMANDIR = /usr/share/man/man3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/share/man/man1 +#USRMANEXT = .1 +#MANCAT = man +#VARRUN = /var/run/dhcp +#VARDB = /var/lib/dhcp +#SCRIPT=linux +##--linux-2.2-- + +## SCO UnixWare 7 +##--uw7-- +#CF = cf/uw7.h +#PREDEFINES=-DUW7 +#RANLIB=true +#LIBS = -lresolv -lsocket -lnsl -lgen +##--uw7-- + +## SCO (with standard cc compiler) +##--sco-cc-- +#CF = cf/sco.h +#PREDEFINES=-DSCO -DBROKEN_ANSI +#BINDIR = /usr/etc +#CLIENTBINDIR=/etc +#ADMMANDIR = /usr/man/cat.ADMN +#ADMMANEXT = .ADMN.Z +#FFMANDIR = /usr/man/cat.SFF +#FFMANEXT = .SFF.Z +#INSTALL = cp +#MANFROM = < +#MANINSTALL = compress +#MANTO = > +#VARRUN = /etc +#VARDB = /etc +#CATMANPAGES= +##--sco-cc-- + +## SCO (with GNU gcc compiler) +##--sco-gcc-- +#CF = cf/sco.h +#CC=gcc +#PREDEFINES=-DSCO +#LIBS = -lsocket +#USERBINDIR = /usr/local/dhcp/bin +#BINDIR = /usr/local/dhcp/bin +#CLIENTBINDIR = /usr/local/dhcp/bin +#ADMMANDIR = /usr/local/dhcp/man/cat.ADMN +#ADMMANEXT = .ADMN.Z +#FFMANDIR = /usr/local/dhcp/man/cat.SFF +#FFMANEXT = .SFF.Z +#INSTALL = /usr/local/bin/install +#MANFROM = < +#MANINSTALL = compress +#MANTO = > +#VARRUN = /usr/local/dhcp/var +#VARDB = /usr/local/dhcp/var +#CATMANPAGES= +#CLIENT_PATH = '"PATH=/bin:/etc:/usr/bin:/tcb/bin:/usr/bin/X11:/usr/local/bin:/usr/local/dhcp/bin"' +##--sco-gcc-- + +## QNX +##--qnx-- +#CF = cf/qnx.h +#ADMMANDIR = /usr/man/man8 +#ADMMANEXT = .8 +#FFMANDIR = /usr/man/man5 +#FFMANEXT = .5 +#LIBMANDIR = /usr/man/man3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/man/man1 +#USRMANEXT = .1 +#MANCAT = man +#VARRUN = /etc +#COPTS=-w3 -Dlint $(BINDDEF) $(CC_OPTIONS) +#LFLAGS=$(DEBUG) "-Wl,op symfile" -l socket +#MANINSTALL = /bin/true +#INSTALL = cp +#BINDIR = /etc +#CLIENTBINDIR = /etc +##--qnx-- + + +## QNX RTP (v6, NTO) +##--qnxnto-- +#CF = cf/qnx.h +#ADMMANDIR = /opt/man/man8 +#ADMMANEXT = .8 +#FFMANDIR = /opt/man/man5 +#FFMANEXT = .5 +#LIBMANDIR = /opt/man/man3 +#LIBMANEXT = .3 +#MANCAT = man +#COPTS=-w3 -Dlint $(BINDDEF) +#LFLAGS=-l socket +#MANINSTALL = /bin/cp +#INSTALL = /bin/cp +#BINDIR = /opt/sbin +#USERBINDIR= /opt/bin +#CLIENTBINDIR = /opt/sbin +##--qnxnto-- + +## CygWin32 +##--cygwin32-- +#CF = cf/cygwin32.h +#ADMMANDIR = /usr/man/man8 +#ADMMANEXT = .8 +#FFMANDIR = /usr/man/man5 +#FFMANEXT = .5 +#LIBMANDIR = /usr/man/man3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/man/man1 +#USRMANEXT = .1 +#VARRUN = /etc +#MANINSTALL = /bin/true +#INSTALL = cp +#BINDIR = /etc +#CLIENTBINDIR = /etc +#CC=/usr/local/i386-unknown-cygwin32/bin/gcc +#AR=/usr/local/i386-unknown-cygwin32/bin/ar +#AS=/usr/local/i386-unknown-cygwin32/bin/as +#LD=/usr/local/i386-unknown-cygwin32/bin/ld +#NM=/usr/local/i386-unknown-cygwin32/bin/nm +#RANLIB=/usr/local/i386-unknown-cygwin32/bin/ranlib +#STRIP=/usr/local/i386-unknown-cygwin32/bin/strip +##--cygwin32-- + +## IRIX 6.x +##--irix-- +#LFLAGS=$(DEBUG) -Wl,-woff,84 -Wl,-woff,85 -Wl,-woff,134 +#CC=gcc +#COPTS = -I/usr/local/include $(BINDDEF) $(CC_OPTIONS) +#CF = cf/irix.h +#BINDIR = /usr/local/etc +#ADMMANDIR = /usr/local/man/man8 +#ADMMANEXT = .8 +#FFMANDIR = /usr/local/man/man5 +#FFMANEXT = .5 +#LIBMANDIR = /usr/local/man/man3 +#LIBMANEXT = .3 +#USRMANDIR = /usr/local/man/man1 +#USRMANEXT = .1 +#MANCAT = man +#INSTALL = install +#MANINSTALL = install +#CHMOD = chmod +#ETC = /etc +#VARRUN = /etc +#VARDB = /usr/local/etc/dhcp +##--irix-- + +## HP-UX +##--hpux-cc-- +#COPTS = $(BINDDEF) $(CC_OPTIONS) +#LFLAGS = -Wl,+vnocompatwarnings +#INSTALL = install -i +#MANINSTALL = install -i +##--hpux-cc-- + +## HP-UX with gcc +##--hpux-gcc-- +#CC = gcc +#CF = cf/hpux.h +#INSTALL = install -i +#ADMMANEXT = .8 +#FFMANEXT = .5 +#MANINSTALL = install -i -m 444 +##--hpux-gcc-- diff --git a/dhcp-dhclient.conf b/dhcp-dhclient.conf new file mode 100644 index 0000000..633ba7c --- /dev/null +++ b/dhcp-dhclient.conf @@ -0,0 +1,3 @@ +# dhclient.conf - DHCP client configuration file +timeout 20; +retry 20; diff --git a/dhcp.spec b/dhcp.spec new file mode 100644 index 0000000..acc4d20 --- /dev/null +++ b/dhcp.spec @@ -0,0 +1,350 @@ +%define patchver %(echo %version | cut -d. -f4) +%define releasever %(echo %version | cut -d. -f1-3) +Name: dhcp +Version: 4.3.0 +Release: 1mamba +Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client +Group: System/Servers +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.isc.org/software/dhcp +Source0: ftp://ftp.isc.org/isc/dhcp/%{releasever}/%{name}-%{releasever}.tar.gz +#Source0: ftp://ftp.freenet.de/pub/ftp.isc.org/isc/dhcp/%{name}-%{releasever}%{?patchver:-%patchver}.tar.gz +Source1: dhcpd-initscript +Source2: dhcpd-conf +Source3: dhcpd-sysconfig +Source4: dhcp-Makefile.conf +Source5: dhcp-dhclient.conf +Patch0: %{name}-3.0.1-dhclient-script-nodomain.patch +Patch1: %{name}-3.0.2-dhclient-log-less-annoying.patch +Patch2: %{name}-4.0.0-dhclient-script-chk4lock.patch +Patch3: %{name}-4.0.0-dhclient-script-setpath.patch +Patch4: %{name}-4.1.0-ping_from_if.patch +License: BSD +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +## AUTOBUILDREQ-END +BuildRequires: idutils +BuildRequires: net-tools +Requires: net-tools +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +DHCP (Dynamic Host Configuration Protocol) is a protocol which allows individual devices on an IP network to get their own network configuration information (IP address, subnetmask, broadcast address, etc.) from a DHCP server. +The overall purpose of DHCP is to make it easier to administer a large network. + +This package contains the DHCP server and a DHCP relay agent. + +%package client +Summary: DHCP client +Group: System/Servers +Requires(post):net-tools +Requires(post):coreutils +Provides: dhcp-common +Obsoletes: dhcp-common +Provides: dhcpclient +Requires: %{name}-common = %{?epoch:%epoch:}%{version}-%{release} + +%description client +DHCP client is the Internet Software Consortium (ISC) DHCP client for various UNIX operating systems. +It allows a UNIX machine to obtain it's networking parameters from a DHCP server. + +%package devel +Summary: DHCP common +Group: System/Servers +Requires: %{name}-common = %{?epoch:%epoch:}%{version}-%{release} + +%description devel +DHCP (Dynamic Host Configuration Protocol) is a protocol which allows individual devices on an IP network to get their own network configuration information (IP address, subnetmask, broadcast address, etc.) from a DHCP server. +The overall purpose of DHCP is to make it easier to administer a large network. +The dhcp package includes the DHCP server and a DHCP relay agent. + +This package contains static libraries and header files need for development. + +%package server +Summary: DHCP server +Group: System/Servers +Requires: %{name}-common = %{?epoch:%epoch:}%{version}-%{release} + +%description server +DHCP (Dynamic Host Configuration Protocol) is a protocol which allows individual devices on an IP network to get their own network configuration information (IP address, subnetmask, broadcast address, etc.) from a DHCP server. +The overall purpose of DHCP is to make it easier to administer a large network. +The dhcp package includes the DHCP server and a DHCP relay agent. + +This package contains the DHCP server. + +%prep +#%setup -q -n %{name}-%{releasever}%{?patchver:-%patchver} +%setup -q -n %{name}-%{releasever} +#%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 + +#cp %{S:4} Makefile.conf +# +#cat << EOF >> includes/site.h +##define _PATH_DHCPD_PID "%{_localstatedir}/run/dhcp/dhcpd.pid" +##define _PATH_DHCPD_DB "%{_localstatedir}/lib/dhcp/dhcpd.leases" +##define _PATH_DHCPD_CONF "%{_sysconfdir}/dhcpd.conf" +#EOF +# +#cat << EOF >> includes/dhcp.h +##define _PATH_DHCLIENT_CONF "%{_sysconfdir}/dhclient.conf" +##define _PATH_DHCLIENT_DB "%{_localstatedir}/lib/dhcp/dhclient.leases" +#EOF + +%build +%if "%{_host}" != "%{_build}" +cat > config.cache << _EOF +ac_cv_file__dev_random=yes +_EOF +%endif +%configure \ + --sbindir=/sbin \ + --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \ + --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \ + --with-srv-pid-file=/run/dhcpd.pid \ + --with-srv6-pid-file=/run/dhcpd6.pid \ + --with-cli-pid-file=/run/dhclient.pid \ + --with-cli6-pid-file=/run/dhclient6.pid \ + --with-relay-pid-file=/run/dhcrelay.pid \ + --with-relay6-pid-file=/run/dhcrelay6.pid \ +%if "%{_host}" != "%{_build}" + --cache-file=config.cache +%endif + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall DESTDIR=%{buildroot} + +install -m0700 client/scripts/linux %{buildroot}/sbin/dhclient-script +install -D %{S:1} %{buildroot}%{_initrddir}/dhcpd +install -D %{S:2} %{buildroot}%{_sysconfdir}/dhcpd.conf +install -D %{S:3} %{buildroot}%{_sysconfdir}/sysconfig/dhcpd +install -D %{S:5} %{buildroot}%{_sysconfdir}/dhclient.conf + +install -d %{buildroot}%{_localstatedir}/lib/dhcp +install -d %{buildroot}%{_localstatedir}/lib/dhclient + +touch %{buildroot}%{_localstatedir}/lib/dhcp/dhcpd.leases + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%preun server +# erase +if [ $1 -eq 0 ]; then + service dhcpd stop + /sbin/chkconfig --del dhcpd +fi +: + +%postun server +# update +if [ $1 -eq 1 ]; then + /sbin/chkconfig dhcpd + [ $? -eq 0 ] && service dhcpd restart +fi +: + +%post client +# Remove "tao" send hostname to fix bug from installations pre <20090705 +RANDOM_PASSWORD=`dd if=/dev/urandom count=128 bs=1 2>&1 | md5sum | cut -b-8` +sed -i "/^send host-name \"tao\"/d" %{_sysconfdir}/dhclient.conf +grep "^send host-name" %{_sysconfdir}/dhclient.conf >/dev/null || { + echo "send host-name \"`hostname`-${RANDOM_PASSWORD}\";" \ + >> %{_sysconfdir}/dhclient.conf +} +: + +%files client +%defattr(-,root,root) +%attr(644,root,root) %config(noreplace) %{_sysconfdir}/dhclient.conf +%{_sysconfdir}/dhclient.conf.example +/sbin/dhclient +/sbin/dhclient-script +%dir %{_localstatedir}/lib/dhclient +%{_mandir}/man5/dhclient* +%{_mandir}/man5/dhcp-* +%{_mandir}/man8/dhclient* +%doc LICENSE + +%files server +%defattr(-,root,root) +%attr(644,root,root) %config(noreplace) %{_sysconfdir}/dhcpd.conf +%attr(644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/dhcpd +%{_sysconfdir}/dhcpd.conf.example +%attr(755,root,root) %{_initrddir}/dhcpd +%{_bindir}/omshell +/sbin/dhcpd +/sbin/dhcrelay +%dir %{_localstatedir}/lib/dhcp +%config(noreplace) %{_localstatedir}/lib/dhcp/dhcpd.leases +%{_mandir}/man1/omshell.* +%{_mandir}/man5/dhcpd.* +%{_mandir}/man8/dhcpd.* +%{_mandir}/man8/dhcrelay.* +%doc LICENSE README RELNOTES +%doc doc + +%files devel +%defattr(-,root,root) +%dir %{_includedir}/dhcpctl +%{_includedir}/dhcpctl/dhcpctl.h +%dir %{_includedir}/isc-dhcp +%{_includedir}/isc-dhcp/*.h +%dir %{_includedir}/omapip +%{_includedir}/omapip/*.h +%{_libdir}/libdhcpctl.a +%{_libdir}/libdst.a +%{_libdir}/libomapi.a +%{_mandir}/man3/* + +%changelog +* Tue Feb 04 2014 Automatic Build System 4.3.0-1mamba +- automatic version update by autodist + +* Wed Sep 11 2013 Automatic Build System 4.2.5.p1-1mamba +- automatic version update by autodist + +* Wed Jul 31 2013 Silvan Calarco 4.2.5.P1-2mamba +- configure for pid files under /run instead of /var/run + +* Tue Mar 26 2013 Automatic Build System 4.2.5.P1-1mamba +- automatic version update by autodist + +* Fri Jan 18 2013 Automatic Build System 4.2.5-1mamba +- automatic version update by autodist + +* Fri Oct 12 2012 Automatic Build System 4.2.4.P2-1mamba +- automatic version update by autodist + +* Thu Aug 16 2012 Automatic Build System 4.2.4.P1-1mamba +- automatic version update by autodist + +* Tue Jun 05 2012 Automatic Build System 4.2.4-1mamba +- automatic version update by autodist + +* Fri Jan 13 2012 Automatic Build System 4.2.3.P2-1mamba +- automatic version update by autodist + +* Sun Dec 18 2011 Automatic Build System 4.2.3.P1-1mamba +- automatic version update by autodist + +* Mon Nov 28 2011 Silvan Calarco 4.2.3-2mamba +- fixed initscript and default configuration for openmamba + +* Sun Oct 23 2011 Automatic Build System 4.2.3-1mamba +- update to 4.2.3 + +* Fri Aug 12 2011 Automatic Build System 4.2.2-1mamba +- update to 4.2.2 + +* Wed Apr 06 2011 Automatic Build System 4.2.1.P1-1mamba +- automatic update by autodist + +* Thu Mar 03 2011 Automatic Build System 4.2.1-1mamba +- automatic update by autodist + +* Fri Feb 04 2011 Silvan Calarco 4.2.0.P2-2mamba +- obsolete dhcp-common +- dchp-client: provide /var/lib/dhclient and dhcpclient +- dhcp-client: add send hostname with random suffix in post script when missing + +* Mon Dec 13 2010 Automatic Build System 4.2.0.P2-1mamba +- automatic update by autodist + +* Thu Dec 02 2010 Silvan Calarco 4.2.0.P1-2mamba +- rebuilt with ipv6 support also to work with NetworkManager (it requires -4 option) + +* Wed Nov 03 2010 Automatic Build System 4.2.0.P1-1mamba +- automatic update to 4.2.0.P1 by autodist + +* Wed Sep 29 2010 Automatic Build System 4.2.0-1mamba +- update to 4.2.0 + +* Thu Jun 03 2010 Automatic Build System 4.1.1.P1-1mamba +- update to 4.1.1.P1 + +* Fri Jan 22 2010 Automatic Build System 4.1.1-1mamba +- automatic update to 4.1.1 by autodist + +* Fri Jul 24 2009 Automatic Build System 4.1.0p1-1mamba +- automatic update to 4.1.0p1 by autodist + +* Sun Jul 05 2009 Silvan Calarco 4.1.0-3mamba +- dhclient.conf: remove default configuration for send host-name and let dhclient use default value + +* Sat Jan 17 2009 Silvan Calarco 4.1.0-2mamba +- dhclient-script: ping ip from proper interface to test gateway reachability + +* Sun Dec 21 2008 Silvan Calarco 4.1.0-1mamba +- automatic update to 4.1.0 by autodist + +* Mon Jul 07 2008 Silvan Calarco 4.0.0-2mamba +- disabled ipv6 support + +* Thu Jul 03 2008 Silvan Calarco 4.0.0-1mamba +- update to 4.0.0 + +* Sun Nov 18 2007 Stefano Cotta Ramusino 3.0.6-1mamba +- update to 3.0.6 + +* Fri May 25 2007 Silvan Calarco 3.0.5-1mamba +- update to 3.0.5 + +* Thu Jun 15 2006 Davide Madrisan 3.0.4-2qilnx +- updated dhcpd initscript to fix qibug 24 + +* Fri May 12 2006 Davide Madrisan 3.0.4-1qilnx +- update to version 3.0.4 by autospec +- fixed license + +* Wed Apr 12 2006 Davide Madrisan 3.0.3-1qilnx +- update to version 3.0.3 by autospec + +* Fri Nov 04 2005 Davide Madrisan 3.0.2-3qilnx +- p#2 modified + +* Thu Nov 03 2005 Davide Madrisan 3.0.2-2qilnx +- p#2: do not overwrite /etc/resolv.conf when locked + +* Mon May 05 2005 Silvan Calarco 3.0.2-1qilnx +- make dhclient-script create /etc/resolv.conf even if domain name was not + passed from DHCP server +- make dhclient log less annoying when a interface is looking for a dhcp + server + +* Fri Oct 22 2004 Silvan Calarco 3.0.1-2qilnx +- added requirement for net-tools + +* Sun Jul 18 2004 Silvan Calarco 3.0.1-1qilnx +- new version build + +* Mon Dec 02 2003 Silvan Calarco 3.0pl2-7qilnx +- removed initscript reload (not supported by dhcpd) + +* Wed Oct 08 2003 Davide Madrisan 3.0p12-6qilnx +- new policies for chkconfig and automatic start/restart of the dhcp service + +* Mon Jul 02 2003 Silvan Calarco 3.0pl2-5qilnx +- fixed dhclient.conf send host-name (a ; was missing) +- fixed initscript [ OK ] alignment + +* Mon Jun 23 2003 Silvan Calarco 3.0pl2-4qilnx +- fixed dhcclient leases dir +- added new-style post and pre scripts + +* Wed May 28 2003 Silvan Calarco 3.0pl2-3qilnx +- added initscripts and configuration + +* Wed Apr 16 2003 Luca Tinelli +- modified description + +* Tue Apr 15 2003 Luca Tinelli +- first build diff --git a/dhcpd-conf b/dhcpd-conf new file mode 100644 index 0000000..58e6e8f --- /dev/null +++ b/dhcpd-conf @@ -0,0 +1,30 @@ +ignore client-updates; + +#subnet 192.168.0.0 netmask 255.255.255.0 { +# +# --- default gateway +# option routers 192.168.0.254; +# option subnet-mask 255.255.255.0; +# +# option nis-domain "domain.it"; +# option domain-name "domain.it"; +# option domain-name-servers 192.168.0.254; +# +# option time-offset -18000; # Eastern Standard Time +# option ntp-servers 192.168.0.1; +# option netbios-name-servers 192.168.0.1; +# --- Selects point-to-point node (default is hybrid). Don't change this unless +# -- you understand Netbios very well +# option netbios-node-type 2; +# +# range dynamic-bootp 192.168.0.1 192.168.0.127; +# default-lease-time 21600; +# max-lease-time 43200; +# +# # we want the nameserver to appear at a fixed address +# host ns { +# next-server dns.domain.it; +# hardware ethernet 01:23:45:67:89:AB; +# fixed-address 1.2.3.4; +# } +#} diff --git a/dhcpd-initscript b/dhcpd-initscript new file mode 100644 index 0000000..c77ef4a --- /dev/null +++ b/dhcpd-initscript @@ -0,0 +1,49 @@ +#!/bin/sh +# Begin $rc_base/init.d/dhcp + +# Based on sysklogd script from LFS-3.1 and earlier. +# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org +# Modified by Silvan Calarco +# Modified by Davide Madrisan +# +# chkconfig: 345 55 15 +# description: The ISC DHCP (Dynamic Host Configuration Protocol) client + +. /etc/sysconfig/rc +. $rc_functions +. $rc_networkfunctions +. /etc/sysconfig/dhcpd +. /etc/sysconfig/network + +case "$1" in + start) + echo -n "Starting DHCP Server..." + for interface in $DHCPDIFS; do + loadproc dhcpd -q $interface $DHCPDARGS + done + echo + ;; + + stop) + echo -n "Stopping DHCP Server..." + killproc dhcpd + echo + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + status) + statusproc dhcpd + ;; + + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/dhcp diff --git a/dhcpd-sysconfig b/dhcpd-sysconfig new file mode 100644 index 0000000..b3365ee --- /dev/null +++ b/dhcpd-sysconfig @@ -0,0 +1,3 @@ +# Command line options here +#DHCPDIFS="eth0" +DHCPDARGS=