(Re)Start the update of the 3.1 versions of the ISC DHCP software

This commit is contained in:
Edwin Groothuis 2008-10-13 12:03:15 +00:00
parent b8a166cee1
commit fede3cc58d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=221536
7 changed files with 41 additions and 142 deletions

View file

@ -16,6 +16,6 @@ SUBSYS= client
# Local overrides # Local overrides
# #
MASTERDIR= ${.CURDIR}/../isc-dhcp3-server MASTERDIR= ${.CURDIR}/../isc-dhcp31-server
.include "${MASTERDIR}/Makefile" .include "${MASTERDIR}/Makefile"

View file

@ -16,6 +16,6 @@ SUBSYS= relay
# Local overrides # Local overrides
# #
MASTERDIR= ${.CURDIR}/../isc-dhcp3-server MASTERDIR= ${.CURDIR}/../isc-dhcp31-server
.include "${MASTERDIR}/Makefile" .include "${MASTERDIR}/Makefile"

View file

@ -7,22 +7,21 @@
# #
PORTNAME= dhcp PORTNAME= dhcp
PORTVERSION= 3.0.5 PORTVERSION= 3.1.1
PORTREVISION= 1
PORTREVISION= ${DHCP_PORTREVISION} PORTREVISION= ${DHCP_PORTREVISION}
CATEGORIES= net CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_ISC} MASTER_SITES= ${MASTER_SITE_ISC}
MASTER_SITE_SUBDIR= dhcp dhcp/dhcp-3.0-history MASTER_SITE_SUBDIR= dhcp dhcp/dhcp-3.1-history
PKGNAMEPREFIX= isc- PKGNAMEPREFIX= isc-
PKGNAMESUFFIX= 3-${SUBSYS} PKGNAMESUFFIX= 31-${SUBSYS}
DISTNAME= ${PORTNAME}-${RELEASE}${VERSION}${PATCHLEVEL} DISTNAME= ${PORTNAME}-${RELEASE}${VERSION}${PATCHLEVEL}
MAINTAINER= Joerg.Pulz@frm2.tum.de MAINTAINER= Joerg.Pulz@frm2.tum.de
COMMENT?= The ISC Dynamic Host Configuration Protocol server COMMENT?= The ISC Dynamic Host Configuration Protocol server
BROKEN= Not yet integrated BROKEN= Not yet integrated and tested
PORTREVISION_SERVER= 2 PORTREVISION_SERVER= 0
PORTREVISION_CLIENT= 0 PORTREVISION_CLIENT= 0
PORTREVISION_RELAY= 0 PORTREVISION_RELAY= 0
PORTREVISION_DEVEL= 0 PORTREVISION_DEVEL= 0
@ -37,11 +36,8 @@ OPTIONS= INTERFACE_POLLING "interface polling support" on
OPTIONS= DHCP_PARANOIA "add -user, -group and -chroot options" on \ OPTIONS= DHCP_PARANOIA "add -user, -group and -chroot options" on \
DHCP_JAIL "add -chroot and -jail options" on \ DHCP_JAIL "add -chroot and -jail options" on \
DHCP_SOCKETS "use sockets instead of /dev/bpf (jail-only)" off \ DHCP_SOCKETS "use sockets instead of /dev/bpf (jail-only)" off \
DHCP_LDAP "add experimental LDAP backend support" off \
DHCP_LDAP_SSL "support LDAP connection over SSL/TLS" on \
OPENSSL_BASE "use the base system OpenSSL (required by TLS)" on \ OPENSSL_BASE "use the base system OpenSSL (required by TLS)" on \
OPENSSL_PORT "use OpenSSL from ports (required by TLS)" off \ OPENSSL_PORT "use OpenSSL from ports (required by TLS)" off
DHCP_LQ "DHCPLEASEQUERY support used by Cisco uBR's" off
.endif .endif
# PORTREVISION handling # PORTREVISION handling
@ -57,30 +53,6 @@ DHCP_PORTREVISION= ${PORTREVISION_SERVER}
.include <bsd.port.pre.mk> .include <bsd.port.pre.mk>
.if ${SUBSYS} == server && defined(WITH_DHCP_LDAP)
# Based on patch from Brian Masney :
PATCH_SITES= http://www.newwave.net/~masneyb/:ldap \
ftp://ftp.frm2.tum.de/pub/jpulz/FreeBSD/:ldap
PATCHFILES= ${PORTNAME}-${RELEASE}${VERSION}${PATCHLEVEL}-ldap-patch:ldap
PATCH_DIST_STRIP= -p1
USE_PERL5_RUN= yes
USE_OPENLDAP= yes
.if !defined(WITHOUT_DHCP_LDAP_SSL)
USE_OPENSSL= yes
# hack to get bsd.openssl.mk included at this late state
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
.endif
.endif
.if ${SUBSYS} == server && defined(WITH_DHCP_LQ)
# Based on patch from Dmitry Sukhodoev :
PATCH_SITES+= http://bingo.ru/~raven/FreeBSD/patches/:dlq \
ftp://ftp.frm2.tum.de/pub/jpulz/FreeBSD/:dlq
PATCHFILES+= ${PORTNAME}-${RELEASE}${VERSION}${PATCHLEVEL}-dlq-patch:dlq
.endif
# Global variables # Global variables
# #
@ -161,11 +133,6 @@ BIN_FILES= dhcpd omshell
USE_RC_SUBR= isc-dhcpd USE_RC_SUBR= isc-dhcpd
SAMP_FILES= server/dhcpd.conf SAMP_FILES= server/dhcpd.conf
DATA_FILES= dhcpd.leases DATA_FILES= dhcpd.leases
.if defined(WITH_DHCP_LDAP)
PORTDOCS+= README.ldap
LDAP_SCRIPT= contrib/dhcpd-conf-to-ldap.pl
LDAP_SCHEMA= contrib/dhcp.schema
.endif
.elif ${SUBSYS} == relay .elif ${SUBSYS} == relay
BIN_FILES= dhcrelay BIN_FILES= dhcrelay
USE_RC_SUBR= isc-dhcrelay USE_RC_SUBR= isc-dhcrelay
@ -179,11 +146,7 @@ DOCSDIR= ${PREFIX}/share/doc/${PKGBASE}
DATADIR= /var/db DATADIR= /var/db
PLIST_SUB+= SCHEMA_DIR="${SCHEMA_DIR:S,^${PREFIX}/,,}" PLIST_SUB+= SCHEMA_DIR="${SCHEMA_DIR:S,^${PREFIX}/,,}"
.if defined(WITH_DHCP_LDAP)
PLIST_SUB+= LDAP=""
.else
PLIST_SUB+= LDAP="@comment " PLIST_SUB+= LDAP="@comment "
.endif
REINPLACE_SUB= PREFIX=${PREFIX} REINPLACE_SUB= PREFIX=${PREFIX}
.if ${OSVERSION} >= 502100 .if ${OSVERSION} >= 502100
SUB_LIST+= NOLOGIN=/usr/sbin/nologin SUB_LIST+= NOLOGIN=/usr/sbin/nologin
@ -222,8 +185,7 @@ extract-script:
post-patch: patch-scripts patch-makefile-conf \ post-patch: patch-scripts patch-makefile-conf \
patch-makefiles-dist patch-man-pages \ patch-makefiles-dist patch-man-pages \
patch-pkgmessage patch-site-conf \ patch-pkgmessage patch-site-conf
patch-dlq
patch-scripts: patch-scripts:
@${REINPLACE_CMD} ${REINPLACE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ @${REINPLACE_CMD} ${REINPLACE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
@ -244,15 +206,6 @@ patch-site-conf:
@${ECHO_CMD} CFLAGS += -DUSE_SOCKETS >> ${WRKSRC}/site.conf @${ECHO_CMD} CFLAGS += -DUSE_SOCKETS >> ${WRKSRC}/site.conf
.endif .endif
.endif .endif
.if defined(WITH_DHCP_LDAP)
@${ECHO_CMD} CFLAGS += -I${LOCALBASE}/include >> ${WRKSRC}/site.conf
@${ECHO_CMD} LIBS += -L${LOCALBASE}/lib >> ${WRKSRC}/site.conf
.if !defined(WITHOUT_DHCP_LDAP_SSL)
@${ECHO_CMD} CFLAGS += -DUSE_SSL -I${OPENSSLINC} >> ${WRKSRC}/site.conf
@${ECHO_CMD} LIBS += -L${OPENSSLLIB} >> ${WRKSRC}/site.conf
@${ECHO_CMD} LIBS += -lcrypto -lssl >> ${WRKSRC}/site.conf
.endif
.endif
.endif .endif
patch-makefile-conf: patch-makefile-conf:
@ -273,21 +226,8 @@ patch-pkgmessage:
.if ${SUBSYS} != devel .if ${SUBSYS} != devel
@${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ @${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${MSG_FILE} > ${PKGMESSAGE} ${MSG_FILE} > ${PKGMESSAGE}
.if defined(WITH_DHCP_LDAP)
@${REINPLACE_CMD} -e 's|^%%LDAP%%||g' ${PKGMESSAGE}
.else
@${REINPLACE_CMD} -e '/^%%LDAP%%/d' ${PKGMESSAGE} @${REINPLACE_CMD} -e '/^%%LDAP%%/d' ${PKGMESSAGE}
.endif .endif
.endif
patch-dlq:
.if ${SUBSYS} == server && defined(WITH_DHCP_LQ)
.if defined(WITH_DHCP_LDAP)
@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-dlq-ldap
.else
@${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-dlq
.endif
.endif
# Post-install # Post-install
# #
@ -299,7 +239,7 @@ post-install: ${POST-INSTALL}
parallel-post-install: \ parallel-post-install: \
strip-binary-files \ strip-binary-files \
install-doc-files install-ldap-files install-sample-files \ install-doc-files install-sample-files \
create-conf-files create-data-files create-conf-files create-data-files
strip-binary-files: strip-binary-files:
@ -320,13 +260,6 @@ install-doc-files:
.endfor .endfor
.endif .endif
install-ldap-files:
.if ${SUBSYS} == server && defined(WITH_DHCP_LDAP)
@${INSTALL_SCRIPT} ${WRKSRC}/${LDAP_SCRIPT} ${PREFIX}/bin
@${MKDIR} ${SCHEMA_DIR}
@${INSTALL_DATA} ${WRKSRC}/${LDAP_SCHEMA} ${SCHEMA_DIR}
.endif
install-sample-files: install-sample-files:
.for f in ${SAMP_FILES} .for f in ${SAMP_FILES}
@${INSTALL_DATA} ${WRKSRC}/${f} ${CONF_DIR}/${f:T}${SAMP_SUFX} @${INSTALL_DATA} ${WRKSRC}/${f} ${CONF_DIR}/${f:T}${SAMP_SUFX}

View file

@ -1,9 +1,3 @@
MD5 (dhcp-3.0.5.tar.gz) = ce5d30d4645e4eab1f54561b487d1ec7 MD5 (dhcp-3.1.1.tar.gz) = fcc19330a9c3a0efb5620409214652a9
SHA256 (dhcp-3.0.5.tar.gz) = dd445fb2a341cdd69e85693dce6f8fda1a1c9d0e98d34c01afc3e68d8037ffb6 SHA256 (dhcp-3.1.1.tar.gz) = 129024c7545e3e8d37e75cd5d534b50c53955592c4935189a57916e216355f6d
SIZE (dhcp-3.0.5.tar.gz) = 876591 SIZE (dhcp-3.1.1.tar.gz) = 798228
MD5 (dhcp-3.0.5-ldap-patch) = 41cde9e9a768bf12390288465ef30bbd
SHA256 (dhcp-3.0.5-ldap-patch) = e700472acb890b504ae5199500a0e87ca1da607946b2f3a8a8958f82d0a277c0
SIZE (dhcp-3.0.5-ldap-patch) = 192308
MD5 (dhcp-3.0.5-dlq-patch) = 0e071945cc986d7ecdfd9b41fc4a102b
SHA256 (dhcp-3.0.5-dlq-patch) = c3fd3200eaf00fa80cb37f19bd3b9edb89497c235b5fa594a0f6f60050f64108
SIZE (dhcp-3.0.5-dlq-patch) = 7655

View file

@ -1,14 +0,0 @@
--- server/Makefile.dist.orig Tue Jun 14 09:37:50 2005
+++ server/Makefile.dist Tue Jun 14 09:37:50 2005
@@ -25,9 +25,9 @@
CATMANPAGES = dhcpd.cat8 dhcpd.conf.cat5 dhcpd.leases.cat5
SEDMANPAGES = dhcpd.man8 dhcpd.conf.man5 dhcpd.leases.man5
SRCS = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
- omapi.c mdb.c stables.c salloc.c ddns.c
+ omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c
OBJS = dhcpd.o dhcp.o bootp.o confpars.o db.o class.o failover.o \
- omapi.o mdb.o stables.o salloc.o ddns.o
+ omapi.o mdb.o stables.o salloc.o ddns.o dhcpleasequery.o
PROG = dhcpd
MAN = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5

View file

@ -1,14 +0,0 @@
--- server/Makefile.dist.orig Tue Jun 14 09:39:39 2005
+++ server/Makefile.dist Tue Jun 14 09:39:39 2005
@@ -25,9 +25,9 @@
CATMANPAGES = dhcpd.cat8 dhcpd.conf.cat5 dhcpd.leases.cat5
SEDMANPAGES = dhcpd.man8 dhcpd.conf.man5 dhcpd.leases.man5
SRCS = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
- ldap.c ldap_casa.c omapi.c mdb.c stables.c salloc.c ddns.c
+ ldap.c ldap_casa.c omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c
OBJS = dhcpd.o dhcp.o bootp.o confpars.o db.o class.o failover.o \
- ldap.o ldap_casa.o omapi.o mdb.o stables.o salloc.o ddns.o
+ ldap.o ldap_casa.o omapi.o mdb.o stables.o salloc.o ddns.o dhcpleasequery.o
PROG = dhcpd
MAN = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5

View file

@ -1,5 +1,5 @@
--- client/dhclient.c.orig Thu Apr 27 23:38:29 2006 --- client/dhclient.c.orig 2008-01-23 06:02:50.000000000 +1100
+++ client/dhclient.c Sat May 6 17:34:55 2006 +++ client/dhclient.c 2008-10-13 22:47:51.000000000 +1100
@@ -38,6 +38,13 @@ @@ -38,6 +38,13 @@
#include "dhcpd.h" #include "dhcpd.h"
#include "version.h" #include "version.h"
@ -27,7 +27,7 @@
static void usage PROTO ((void)); static void usage PROTO ((void));
@@ -174,6 +184,9 @@ @@ -181,6 +191,9 @@
} else if (!strcmp (argv [i], "-q")) { } else if (!strcmp (argv [i], "-q")) {
quiet = 1; quiet = 1;
quiet_interface_discovery = 1; quiet_interface_discovery = 1;
@ -37,7 +37,7 @@
} else if (!strcmp (argv [i], "-s")) { } else if (!strcmp (argv [i], "-s")) {
if (++i == argc) if (++i == argc)
usage (); usage ();
@@ -187,6 +200,19 @@ @@ -194,6 +207,19 @@
} else if (!strcmp (argv [i], "-n")) { } else if (!strcmp (argv [i], "-n")) {
/* do not start up any interfaces */ /* do not start up any interfaces */
interfaces_requested = 1; interfaces_requested = 1;
@ -57,7 +57,7 @@
} else if (!strcmp (argv [i], "-w")) { } else if (!strcmp (argv [i], "-w")) {
/* do not exit if there are no broadcast interfaces. */ /* do not exit if there are no broadcast interfaces. */
persist = 1; persist = 1;
@@ -215,7 +241,16 @@ @@ -222,7 +248,16 @@
if (strlen(argv[i]) >= sizeof(tmp->name)) if (strlen(argv[i]) >= sizeof(tmp->name))
log_fatal("%s: interface name too long (is %ld)", log_fatal("%s: interface name too long (is %ld)",
argv [i], (long)strlen(argv[i])); argv [i], (long)strlen(argv[i]));
@ -75,7 +75,7 @@
if (interfaces) { if (interfaces) {
interface_reference (&tmp -> next, interface_reference (&tmp -> next,
interfaces, MDL); interfaces, MDL);
@@ -375,6 +410,16 @@ @@ -380,6 +415,16 @@
INTERFACE_AUTOMATIC)) != INTERFACE_AUTOMATIC)) !=
INTERFACE_REQUESTED)) INTERFACE_REQUESTED))
continue; continue;
@ -92,7 +92,7 @@
script_init (ip -> client, script_init (ip -> client,
"PREINIT", (struct string_list *)0); "PREINIT", (struct string_list *)0);
if (ip -> client -> alias) if (ip -> client -> alias)
@@ -417,8 +462,13 @@ @@ -424,8 +469,13 @@
client -> state = S_INIT; client -> state = S_INIT;
/* Set up a timeout to start the initialization /* Set up a timeout to start the initialization
process. */ process. */
@ -106,20 +106,20 @@
} }
} }
} }
@@ -476,9 +526,9 @@ @@ -483,9 +533,10 @@
log_info (arr); log_info (arr);
log_info (url); log_info (url);
- log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s", - log_error ("Usage: dhclient [-1dqrx] [-nw] [-p <port>] %s",
- "[-s server]"); + log_error ("Usage: dhclient [-1dqrvx] [-i polling-interval] %s",\
+ "[-nw] [-p <port>] %s",
"[-s server]");
- log_error (" [-cf config-file] [-lf lease-file]%s", - log_error (" [-cf config-file] [-lf lease-file]%s",
+ log_error ("Usage: dhclient [-1Ddqrv] [-i polling-interval] %s",
+ "[-nw] [-p <port>] [-s server]");
+ log_error (" [-cf config-file] [-lf lease-file] %s", + log_error (" [-cf config-file] [-lf lease-file] %s",
"[-pf pid-file] [-e VAR=val]"); "[-pf pid-file] [-e VAR=val]");
log_fatal (" [-sf script-file] [interface]"); log_fatal (" [-sf script-file] [interface]");
} }
@@ -879,6 +929,15 @@ @@ -886,6 +937,15 @@
/* Write out the new lease. */ /* Write out the new lease. */
write_client_lease (client, client -> new, 0, 0); write_client_lease (client, client -> new, 0, 0);
@ -135,7 +135,7 @@
/* Replace the old active lease with the new one. */ /* Replace the old active lease with the new one. */
if (client -> active) if (client -> active)
destroy_client_lease (client -> active); destroy_client_lease (client -> active);
@@ -893,6 +952,12 @@ @@ -900,6 +960,12 @@
piaddr (client -> active -> address), piaddr (client -> active -> address),
(long)(client -> active -> renewal - cur_time)); (long)(client -> active -> renewal - cur_time));
client -> state = S_BOUND; client -> state = S_BOUND;
@ -148,7 +148,7 @@
reinitialize_interfaces (); reinitialize_interfaces ();
go_daemon (); go_daemon ();
if (client -> config -> do_forward_update) { if (client -> config -> do_forward_update) {
@@ -1357,6 +1422,11 @@ @@ -1422,6 +1488,11 @@
int interval; int interval;
int increase = 1; int increase = 1;
@ -160,7 +160,7 @@
/* Figure out how long it's been since we started transmitting. */ /* Figure out how long it's been since we started transmitting. */
interval = cur_time - client -> first_sending; interval = cur_time - client -> first_sending;
@@ -1457,6 +1527,9 @@ @@ -1522,6 +1593,9 @@
struct client_lease *loop; struct client_lease *loop;
struct client_lease *lp; struct client_lease *lp;
@ -170,7 +170,7 @@
loop = lp = client -> active; loop = lp = client -> active;
log_info ("No DHCPOFFERS received."); log_info ("No DHCPOFFERS received.");
@@ -1489,6 +1562,10 @@ @@ -1554,6 +1628,10 @@
log_info ("bound: renewal in %ld %s.", log_info ("bound: renewal in %ld %s.",
(long)(client -> active -> renewal - (long)(client -> active -> renewal -
cur_time), "seconds"); cur_time), "seconds");
@ -181,7 +181,7 @@
add_timeout (client -> active -> renewal, add_timeout (client -> active -> renewal,
state_bound, client, 0, 0); state_bound, client, 0, 0);
} else { } else {
@@ -1496,6 +1573,11 @@ @@ -1561,6 +1639,11 @@
log_info ("bound: immediate renewal."); log_info ("bound: immediate renewal.");
state_bound (client); state_bound (client);
} }
@ -193,7 +193,7 @@
reinitialize_interfaces (); reinitialize_interfaces ();
go_daemon (); go_daemon ();
return; return;
@@ -1541,6 +1623,12 @@ @@ -1606,6 +1689,12 @@
} }
log_info ("No working leases in persistent database - sleeping."); log_info ("No working leases in persistent database - sleeping.");
@ -206,7 +206,7 @@
script_init (client, "FAIL", (struct string_list *)0); script_init (client, "FAIL", (struct string_list *)0);
if (client -> alias) if (client -> alias)
script_write_params (client, "alias_", client -> alias); script_write_params (client, "alias_", client -> alias);
@@ -1682,6 +1770,18 @@ @@ -1747,6 +1836,18 @@
client -> packet.secs = htons (65535); client -> packet.secs = htons (65535);
} }
@ -225,7 +225,7 @@
log_info ("DHCPREQUEST on %s to %s port %d", log_info ("DHCPREQUEST on %s to %s port %d",
client -> name ? client -> name : client -> interface -> name, client -> name ? client -> name : client -> interface -> name,
inet_ntoa (destination.sin_addr), inet_ntoa (destination.sin_addr),
@@ -1703,6 +1803,16 @@ @@ -1768,6 +1869,16 @@
from, &destination, from, &destination,
(struct hardware *)0); (struct hardware *)0);
@ -242,7 +242,7 @@
add_timeout (cur_time + client -> interval, add_timeout (cur_time + client -> interval,
send_request, client, 0, 0); send_request, client, 0, 0);
} }
@@ -2600,6 +2710,13 @@ @@ -2654,6 +2765,13 @@
wstatus = 0; wstatus = 0;
} }
} else { } else {
@ -253,10 +253,10 @@
+ if (i > STDERR_FILENO) + if (i > STDERR_FILENO)
+ close(i); + close(i);
+ } + }
execve (scriptName, argv, envp); /* We don't want to pass an open file descriptor for
log_error ("execve (%s, ...): %m", scriptName); * dhclient.leases when executing dhclient-script.
exit (0); */
@@ -2786,8 +2903,10 @@ @@ -2840,8 +2958,10 @@
case S_STOPPED: case S_STOPPED:
break; break;
} }
@ -267,7 +267,7 @@
} }
} }
} }
@@ -3015,7 +3134,9 @@ @@ -3069,7 +3189,9 @@
break; break;
case server_awaken: case server_awaken:
@ -277,7 +277,7 @@
break; break;
} }
} }
@@ -3153,3 +3274,265 @@ @@ -3207,3 +3329,265 @@
data_string_forget (&ddns_dhcid, MDL); data_string_forget (&ddns_dhcid, MDL);
return rcode; return rcode;
} }