net-misc/dhcp: Bump

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/mds@1995 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one
2010-02-14 06:43:52 +00:00
parent 0be4b0483f
commit 5b3b906281
19 changed files with 740 additions and 673 deletions

View File

@@ -0,0 +1,13 @@
diff -ur a/server/dhcpd.conf b/server/dhcpd.conf
--- a/server/dhcpd.conf 2001-01-25 08:33:11 +0000
+++ b/server/dhcpd.conf 2007-07-19 10:29:43 +0100
@@ -21,6 +21,9 @@
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
+# Disable dynamic DNS updates.
+ddns-update-style none;
+
subnet 10.152.187.0 netmask 255.255.255.0 {
}

View File

@@ -0,0 +1,77 @@
--- client/clparse.c.orig 2006-02-22 09:37:12.000000000 +0000
+++ client/clparse.c 2006-02-22 09:38:26.000000000 +0000
@@ -97,6 +97,11 @@
status = read_client_conf_file (path_dhclient_conf,
(struct interface_info *)0,
&top_level_config);
+
+ /* Read any extra configuration from stdin */
+ read_client_conf_stdin ((struct interface_info *)0,
+ &top_level_config);
+
if (status != ISC_R_SUCCESS) {
;
#ifdef LATER
@@ -148,20 +153,17 @@
return status;
}
-int read_client_conf_file (const char *name, struct interface_info *ip,
- struct client_config *client)
+int read_client_conf_actual (int file, const char *name,
+ struct interface_info *ip,
+ struct client_config *client)
{
- int file;
struct parse *cfile;
const char *val;
int token;
isc_result_t status;
- if ((file = open (name, O_RDONLY)) < 0)
- return uerr2isc (errno);
-
cfile = (struct parse *)0;
- new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0);
+ new_parse (&cfile, file, (char *)0, 0, name , 0);
do {
token = peek_token (&val, (unsigned *)0, cfile);
@@ -174,11 +174,36 @@
status = (cfile -> warnings_occurred
? ISC_R_BADPARSE
: ISC_R_SUCCESS);
- close (file);
end_parse (&cfile);
return status;
}
+int read_client_conf_file (const char *name, struct interface_info *ip,
+ struct client_config *client)
+{
+ int file;
+ isc_result_t status;
+
+ if ((file = open (name, O_RDONLY)) < 0)
+ return uerr2isc (errno);
+
+ status = read_client_conf_actual(file, name, ip, client);
+
+ return status;
+}
+
+
+int read_client_conf_stdin (struct interface_info *ip,
+ struct client_config *client)
+{
+ int file = fileno(stdin);
+ isc_result_t status;
+
+ if (isatty(file)) return ISC_R_NOTFOUND;
+ status = read_client_conf_actual(file, "stdin", ip, client);
+
+ return status;
+}
/* lease-file :== client-lease-statements END_OF_FILE
client-lease-statements :== <nil>

View File

@@ -0,0 +1,12 @@
--- work.linux-2.2/common/tr.c 2005/08/14 11:34:24 1.1
+++ work.linux-2.2/common/tr.c 2005/08/14 11:35:16
@@ -40,6 +40,9 @@ static char copyright[] =
#include "includes/netinet/if_ether.h"
#include "netinet/if_tr.h"
#include <sys/time.h>
+#ifdef __linux__
+#include <linux/types.h>
+#endif
/*
* token ring device handling subroutines. These are required as token-ring

View File

@@ -0,0 +1,216 @@
--- dhcp-3.0.2/common/parse.c.extended_option_environment 2005-04-05 17:49:36.513062562 -0400
+++ dhcp-3.0.2/common/parse.c 2005-04-05 17:49:36.580052656 -0400
@@ -1270,6 +1270,10 @@
option_hash_add (option -> universe -> hash,
(const char *)option -> name,
0, option, MDL);
+#ifdef EXTENDED_NEW_OPTION_INFO
+ if ( new_option_info_tree != 0L )
+ add_new_option_info( option );
+#endif
return 1;
}
--- dhcp-3.0.2/common/tables.c.extended_option_environment 2004-09-01 13:06:35.000000000 -0400
+++ dhcp-3.0.2/common/tables.c 2005-04-05 18:04:23.915838623 -0400
@@ -1238,3 +1238,40 @@
fqdn_universe.name, 0,
&fqdn_universe, MDL);
}
+
+#ifdef EXTENDED_NEW_OPTION_INFO
+#include <search.h>
+
+void *new_option_info_tree = 0L;
+
+static int new_option_info_comparator( const void* p1, const void *p2 )
+{
+ uint32_t ocode1 = (((const struct option*)p1)->universe->index << 8)
+ |(((const struct option*)p1)->code),
+ ocode2 = (((const struct option*)p2)->universe->index << 8)
+ |(((const struct option*)p2)->code);
+ return( (ocode1 == ocode2)
+ ? 0
+ :( ( ocode1 > ocode2 )
+ ? 1
+ : -1
+ )
+ );
+}
+
+void *add_new_option_info( struct option *option )
+{
+ if ( option->universe->index >= fqdn_universe.index )
+ return 0L;
+ if ( new_option_info_tree == GENERATE_NEW_OPTION_INFO )
+ new_option_info_tree = (void*)0L;
+ return tsearch( option, &(new_option_info_tree), new_option_info_comparator );
+}
+
+void *lookup_new_option_info( struct option *option )
+{
+ if ( new_option_info_tree == GENERATE_NEW_OPTION_INFO )
+ return 0L;
+ return tfind( option, &(new_option_info_tree), new_option_info_comparator );
+}
+#endif
--- dhcp-3.0.2/includes/dhcpd.h.extended_option_environment 2004-11-24 12:39:16.000000000 -0500
+++ dhcp-3.0.2/includes/dhcpd.h 2005-04-05 17:49:36.613047777 -0400
@@ -1800,6 +1800,13 @@
void initialize_common_option_spaces PROTO ((void));
struct universe *config_universe;
+#ifdef EXTENDED_NEW_OPTION_INFO
+#define GENERATE_NEW_OPTION_INFO ((void*)1)
+extern void *new_option_info_tree;
+extern void *add_new_option_info( struct option*);
+extern void *lookup_new_option_info( struct option *);
+#endif
+
/* stables.c */
#if defined (FAILOVER_PROTOCOL)
extern failover_option_t null_failover_option;
--- dhcp-3.0.2/client/dhclient.c.extended_option_environment 2005-04-05 17:49:36.566054726 -0400
+++ dhcp-3.0.2/client/dhclient.c 2005-04-05 17:49:36.617047185 -0400
@@ -74,7 +74,9 @@
int onetry=0;
int quiet=0;
int nowait=0;
-
+#ifdef EXTENDED_NEW_OPTION_INFO
+int extended_option_environment = 0;
+#endif
static void usage PROTO ((void));
void do_release(struct client_state *);
@@ -204,6 +206,11 @@
} else if (!strcmp (argv [i], "--version")) {
log_info ("isc-dhclient-%s", DHCP_VERSION);
exit (0);
+#ifdef EXTENDED_NEW_OPTION_INFO
+ } else if (!strcmp (argv [i], "-x")) {
+ extended_option_environment = 1;
+ new_option_info_tree = GENERATE_NEW_OPTION_INFO;
+#endif
} else if (argv [i][0] == '-') {
usage ();
} else {
@@ -572,7 +579,11 @@
log_info (arr);
log_info (url);
+#ifdef EXTENDED_NEW_OPTION_INFO
+ log_error ("Usage: dhclient [-1dqr] [-nwx] [-p <port>] %s",
+#else
log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
+#endif
"[-s server]");
log_error (" [-cf config-file] [-lf lease-file]%s",
"[-pf pid-file] [-e VAR=val]");
@@ -2529,8 +2540,28 @@
struct envadd_state {
struct client_state *client;
const char *prefix;
+ struct universe *universe;
};
+#ifdef EXTENDED_NEW_OPTION_INFO
+static
+void build_universe_info_envvar
+( struct option_cache *oc,
+ struct packet *p, struct lease *l,
+ struct client_state *client,
+ struct option_state *in_o,
+ struct option_state *cf_o,
+ struct binding_scope **scope,
+ struct universe *u, void *es
+)
+{
+ char info_name[512], info_data[512];
+ snprintf(info_name, 512, "%s._universe_.", oc->option->universe->name);
+ snprintf(info_data, 512, "%u:%s", oc->option->code,oc->option->format);
+ client_envadd( client, info_name, oc->option->name, info_data );
+}
+#endif
+
void client_option_envadd (struct option_cache *oc,
struct packet *packet, struct lease *lease,
struct client_state *client_state,
@@ -2547,6 +2578,31 @@
in_options, cfg_options, scope, oc, MDL)) {
if (data.len) {
char name [256];
+#ifdef EXTENDED_NEW_OPTION_INFO
+ if ( extended_option_environment )
+ {
+ if( ( oc->option->universe != &dhcp_universe )
+ &&( oc->option->universe->index > fqdn_universe.index )
+ &&( es->universe != oc->option->universe )
+ )
+ {
+ es->universe = oc->option->universe;
+ (*(es->universe->foreach))
+ ( (struct packet *)0, (struct lease *)0,
+ client_state,
+ in_options, cfg_options,
+ scope, es->universe, es,
+ build_universe_info_envvar
+ );
+ }else
+ if ( lookup_new_option_info(oc->option) != 0L )
+ build_universe_info_envvar
+ ( oc, packet, lease, client_state,
+ in_options, cfg_options, scope,
+ oc->option->universe, es
+ );
+ }
+#endif
if (dhcp_option_ev_name (name, sizeof name,
oc -> option)) {
client_envadd (es -> client, es -> prefix,
@@ -2575,6 +2631,7 @@
es.client = client;
es.prefix = prefix;
+ es.universe = 0L;
client_envadd (client,
prefix, "ip_address", "%s", piaddr (lease -> address));
@@ -2788,7 +2845,14 @@
s = option -> name;
if (j + 1 == buflen)
return 0;
+#ifdef EXTENDED_NEW_OPTION_INFO
+ if ( ! extended_option_environment )
+ buf [j++] = '_';
+ else
+ buf [j++] = '.';
+#else
buf [j++] = '_';
+#endif
}
++i;
} while (i != 2);
--- dhcp-3.0.2/client/dhclient.8.extended_option_environment 2004-09-29 19:01:46.000000000 -0400
+++ dhcp-3.0.2/client/dhclient.8 2005-04-05 17:49:36.619046889 -0400
@@ -78,6 +78,9 @@
.B -w
]
[
+.B -x
+]
+[
.I if0
[
.I ...ifN
@@ -252,6 +255,10 @@
supplying the
.B -nw
flag.
+.PP
+The -x argument enables eXtended option information to be created in the
+-s dhclient-script environment, which would allow applications running
+in that environment to handle options they do not know about in advance.
.SH CONFIGURATION
The syntax of the dhclient.conf(5) file is discussed separately.
.SH OMAPI

View File

@@ -0,0 +1,14 @@
--- dhcp-3.1.1.orig/client/dhclient.c
+++ dhcp-3.1.1/client/dhclient.c
@@ -2547,8 +2547,9 @@ void script_write_params (client, prefix
(struct option_state *)0,
lease -> options,
&global_scope, oc, MDL)) {
- if (data.len > 3) {
- struct iaddr netmask, subnet, broadcast;
+ struct iaddr netmask;
+ if (data.len > 3 && data.len <= sizeof(netmask.iabuf)) {
+ struct iaddr subnet, broadcast;
memcpy (netmask.iabuf, data.data, data.len);
netmask.len = data.len;

View File

@@ -1,14 +1,14 @@
--- /usr/portage/net-misc/dhcp/dhcp-3.1.1.ebuild 2009-04-05 12:37:41.000000000 +0200
+++ dhcp-3.1.2.ebuild 2009-07-08 19:11:03.383208313 +0200
+++ dhcp-3.1.3.ebuild 2009-07-08 19:11:03.383208313 +0200
@@ -1,24 +1,31 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-3.1.1.ebuild,v 1.9 2008/11/05 00:41:46 vapier Exp $
inherit eutils flag-o-matic multilib toolchain-funcs
+LDAP_PV="3.1.2-1.1"
+LDAP_PV="3.1.3-1"
+
MY_PV="${PV//_alpha/a}"
MY_PV="${MY_PV//_beta/b}"

View File

@@ -0,0 +1,12 @@
diff -uNr dhcp-3.1.2.ORIG/server/dhcp.c dhcp-3.1.2/server/dhcp.c
--- dhcp-3.1.2.ORIG/server/dhcp.c 2009-07-13 14:26:15.000000000 +0100
+++ dhcp-3.1.2/server/dhcp.c 2009-07-13 14:26:33.000000000 +0100
@@ -1747,6 +1747,8 @@
host_reference (&host, h, MDL);
}
if (!host) {
+ if (hp)
+ host_dereference (&hp, MDL);
find_hosts_by_haddr (&hp,
packet -> raw -> htype,
packet -> raw -> chaddr,

View File

@@ -0,0 +1,115 @@
diff -ur a/client/clparse.c b/client/clparse.c
--- a/client/clparse.c 2008-09-03 21:39:30.000000000 +0100
+++ b/client/clparse.c 2008-09-03 23:10:48.000000000 +0100
@@ -172,6 +172,10 @@
#endif
}
+ /* Read any extra configuration from stdin */
+ read_client_conf_stdin ((struct interface_info *)0,
+ &top_level_config);
+
/* Set up state and config structures for clients that don't
have per-interface configuration statements. */
config = (struct client_config *)0;
@@ -201,21 +205,13 @@
return status;
}
-int read_client_conf_file (const char *name, struct interface_info *ip,
- struct client_config *client)
+int read_client_conf_actual (struct parse *cfile, struct interface_info *ip,
+ struct client_config *client)
{
- int file;
- struct parse *cfile;
const char *val;
int token;
isc_result_t status;
- if ((file = open (name, O_RDONLY)) < 0)
- return uerr2isc (errno);
-
- cfile = (struct parse *)0;
- new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0);
-
do {
token = peek_token (&val, (unsigned *)0, cfile);
if (token == END_OF_FILE)
@@ -226,10 +222,74 @@
status = (cfile -> warnings_occurred
? ISC_R_BADPARSE
: ISC_R_SUCCESS);
+ return status;
+}
+
+int read_client_conf_file (const char *name, struct interface_info *ip,
+ struct client_config *client)
+{
+ int file;
+ struct parse *cfile;
+ isc_result_t status;
+
+ if ((file = open (name, O_RDONLY)) < 0)
+ return uerr2isc (errno);
+
+ cfile = (struct parse *)0;
+ new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0);
+ status = read_client_conf_actual(cfile, ip, client);
end_parse (&cfile);
return status;
}
+int read_client_conf_stdin (struct interface_info *ip,
+ struct client_config *client)
+{
+ int file;
+ char *buffer = NULL, *p;
+ unsigned buflen, len = 0;
+ struct parse *cfile;
+ size_t bytes;
+ isc_result_t status;
+
+ file = fileno(stdin);
+ if (isatty (file))
+ return ISC_R_NOTFOUND;
+ if (fcntl (file, F_SETFL, O_NONBLOCK) < 0)
+ log_fatal ("could not set stdin to non blocking!");
+
+ buflen = BUFSIZ;
+ buffer = malloc (BUFSIZ + 1);
+ p = buffer;
+ do {
+ bytes = read (file, p, BUFSIZ);
+ if (bytes == 0)
+ break;
+ if (bytes == -1)
+ log_fatal ("failed to read stdin!");
+ if (bytes >= BUFSIZ) {
+ buflen += BUFSIZ;
+ len += BUFSIZ;
+ buffer = realloc (buffer, buflen + 1);
+ if (!buffer)
+ log_fatal ("not enough buffer to read stdin!");
+ p = buffer + len;
+ } else {
+ len += bytes;
+ break;
+ }
+ } while(1);
+ buffer[len] = '\0';
+
+ cfile = (struct parse *)0;
+ status = new_parse (&cfile, -1, buffer, len, "stdin", 0);
+ if (status == ISC_R_SUCCESS) {
+ status = read_client_conf_actual (cfile, ip, client);
+ end_parse (&cfile);
+ }
+ free(buffer);
+ return status;
+}
/* lease-file :== client-lease-statements END_OF_FILE
client-lease-statements :== <nil>
Files a/client/clparse.o and b/client/clparse.o differ
Files a/client/dhclient and b/client/dhclient differ

View File

@@ -1,6 +1,6 @@
diff -uNr dhcp-4.1.0.orig/client/scripts/bsdos dhcp-4.1.0/client/scripts/bsdos
--- dhcp-4.1.0.orig/client/scripts/bsdos 2009-07-08 20:47:32.631747061 +0200
+++ dhcp-4.1.0/client/scripts/bsdos 2009-07-08 20:48:21.198858540 +0200
diff -uNr dhcp-4.1.0.ORIG/client/scripts/bsdos dhcp-4.1.0/client/scripts/bsdos
--- dhcp-4.1.0.ORIG/client/scripts/bsdos 2009-07-09 15:16:11.000000000 +0100
+++ dhcp-4.1.0/client/scripts/bsdos 2009-07-09 15:17:41.000000000 +0100
@@ -102,6 +102,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"
@@ -29,9 +29,9 @@ diff -uNr dhcp-4.1.0.orig/client/scripts/bsdos dhcp-4.1.0/client/scripts/bsdos
sleep 1
if [ "$new_routers" != "" ]; then
set $new_routers
diff -uNr dhcp-4.1.0.orig/client/scripts/freebsd dhcp-4.1.0/client/scripts/freebsd
--- dhcp-4.1.0.orig/client/scripts/freebsd 2009-07-08 20:47:32.631747061 +0200
+++ dhcp-4.1.0/client/scripts/freebsd 2009-07-08 20:48:21.198858540 +0200
diff -uNr dhcp-4.1.0.ORIG/client/scripts/freebsd dhcp-4.1.0/client/scripts/freebsd
--- dhcp-4.1.0.ORIG/client/scripts/freebsd 2009-07-09 15:16:11.000000000 +0100
+++ dhcp-4.1.0/client/scripts/freebsd 2009-07-09 15:17:41.000000000 +0100
@@ -112,6 +112,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"
@@ -60,9 +60,9 @@ diff -uNr dhcp-4.1.0.orig/client/scripts/freebsd dhcp-4.1.0/client/scripts/freeb
$LOGGER "New IP Address ($interface): $new_ip_address"
$LOGGER "New Subnet Mask ($interface): $new_subnet_mask"
$LOGGER "New Broadcast Address ($interface): $new_broadcast_address"
diff -uNr dhcp-4.1.0.orig/client/scripts/linux dhcp-4.1.0/client/scripts/linux
--- dhcp-4.1.0.orig/client/scripts/linux 2009-07-08 20:47:32.631747061 +0200
+++ dhcp-4.1.0/client/scripts/linux 2009-07-08 20:48:53.235881547 +0200
diff -uNr dhcp-4.1.0.ORIG/client/scripts/linux dhcp-4.1.0/client/scripts/linux
--- dhcp-4.1.0.ORIG/client/scripts/linux 2009-07-09 15:16:11.000000000 +0100
+++ dhcp-4.1.0/client/scripts/linux 2009-07-09 15:20:50.000000000 +0100
@@ -104,11 +104,6 @@
fi
fi
@@ -113,43 +113,21 @@ diff -uNr dhcp-4.1.0.orig/client/scripts/linux dhcp-4.1.0/client/scripts/linux
+ route del -net $new_network_number $new_subnet_arg \
+ dev $interface
+ route add -net $new_network_number $new_subnet_arg $metric_arg \
+ dev $interface
+ dev $interface
fi
for router in $new_routers; do
if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
route add -host $router dev $interface
- route add -host $router dev $interface
+ route add -host $router $metric_arg dev $interface
fi
- route add default gw $router
+ route add default gw $router $metric_arg dev $interface
done
fi
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
@@ -243,15 +235,18 @@
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
route add -host $alias_ip_address dev $interface:0
fi
- if [ $relmajor -lt 2 ] || \
- ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
- route add -net $new_network_number
+ # Add a network route to the computed network address.
+ if [ x$IF_METRIC != x ] && [ x$IF_METRIC != x0 ]; then
+ route del -net $new_network_number $new_subnet_arg \
+ dev $interface
+ route add -net $new_network_number $new_subnet_arg $metric_arg \
+ dev $interface
fi
for router in $new_routers; do
if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
route add -host $router dev $interface
fi
- route add default gw $router
+ route add default gw $router $metric_arg dev $interface
done
make_resolv_conf
exit_with_hooks 0
diff -uNr dhcp-4.1.0.orig/client/scripts/netbsd dhcp-4.1.0/client/scripts/netbsd
--- dhcp-4.1.0.orig/client/scripts/netbsd 2009-07-08 20:47:32.631747061 +0200
+++ dhcp-4.1.0/client/scripts/netbsd 2009-07-08 20:48:21.201176019 +0200
diff -uNr dhcp-4.1.0.ORIG/client/scripts/netbsd dhcp-4.1.0/client/scripts/netbsd
--- dhcp-4.1.0.ORIG/client/scripts/netbsd 2009-07-09 15:16:11.000000000 +0100
+++ dhcp-4.1.0/client/scripts/netbsd 2009-07-09 15:17:41.000000000 +0100
@@ -102,6 +102,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"
@@ -178,9 +156,9 @@ diff -uNr dhcp-4.1.0.orig/client/scripts/netbsd dhcp-4.1.0/client/scripts/netbsd
sleep 1
if [ "$new_routers" != "" ]; then
set $new_routers
diff -uNr dhcp-4.1.0.orig/client/scripts/solaris dhcp-4.1.0/client/scripts/solaris
--- dhcp-4.1.0.orig/client/scripts/solaris 2009-07-08 20:47:32.631747061 +0200
+++ dhcp-4.1.0/client/scripts/solaris 2009-07-08 20:48:21.203487631 +0200
diff -uNr dhcp-4.1.0.ORIG/client/scripts/solaris dhcp-4.1.0/client/scripts/solaris
--- dhcp-4.1.0.ORIG/client/scripts/solaris 2009-07-09 15:16:11.000000000 +0100
+++ dhcp-4.1.0/client/scripts/solaris 2009-07-09 15:17:41.000000000 +0100
@@ -97,6 +97,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"

View File

@@ -1,6 +1,6 @@
diff -uNr dhcp-4.1.0.orig/client/dhclient.c dhcp-4.1.0/client/dhclient.c
--- dhcp-4.1.0.orig/client/dhclient.c 2009-07-08 20:53:54.570853169 +0200
+++ dhcp-4.1.0/client/dhclient.c 2009-07-08 20:55:59.448693983 +0200
diff -uNr dhcp-4.1.0.ORIG/client/dhclient.c dhcp-4.1.0/client/dhclient.c
--- dhcp-4.1.0.ORIG/client/dhclient.c 2009-07-09 15:29:40.000000000 +0100
+++ dhcp-4.1.0/client/dhclient.c 2009-07-09 15:30:19.000000000 +0100
@@ -87,6 +87,8 @@
static isc_result_t write_duid(struct data_string *duid);
@@ -18,9 +18,9 @@ diff -uNr dhcp-4.1.0.orig/client/dhclient.c dhcp-4.1.0/client/dhclient.c
quiet_interface_discovery = 1;
}
diff -uNr dhcp-4.1.0.orig/omapip/errwarn.c dhcp-4.1.0/omapip/errwarn.c
--- dhcp-4.1.0.orig/omapip/errwarn.c 2009-07-08 20:53:54.573168693 +0200
+++ dhcp-4.1.0/omapip/errwarn.c 2009-07-08 20:54:52.318516628 +0200
diff -uNr dhcp-4.1.0.ORIG/omapip/errwarn.c dhcp-4.1.0/omapip/errwarn.c
--- dhcp-4.1.0.ORIG/omapip/errwarn.c 2009-07-09 15:29:40.000000000 +0100
+++ dhcp-4.1.0/omapip/errwarn.c 2009-07-09 15:29:52.000000000 +0100
@@ -43,6 +43,8 @@
int log_perror = 1;
#endif
@@ -54,9 +54,9 @@ diff -uNr dhcp-4.1.0.orig/omapip/errwarn.c dhcp-4.1.0/omapip/errwarn.c
if (log_cleanup)
(*log_cleanup) ();
exit (1);
diff -uNr dhcp-4.1.0.orig/relay/dhcrelay.c dhcp-4.1.0/relay/dhcrelay.c
--- dhcp-4.1.0.orig/relay/dhcrelay.c 2009-07-08 20:53:54.543072262 +0200
+++ dhcp-4.1.0/relay/dhcrelay.c 2009-07-08 20:56:46.552266455 +0200
diff -uNr dhcp-4.1.0.ORIG/relay/dhcrelay.c dhcp-4.1.0/relay/dhcrelay.c
--- dhcp-4.1.0.ORIG/relay/dhcrelay.c 2009-07-09 15:29:40.000000000 +0100
+++ dhcp-4.1.0/relay/dhcrelay.c 2009-07-09 15:31:53.000000000 +0100
@@ -130,6 +130,7 @@
static char arr[] = "All rights reserved.";
static char message[] = "Internet Systems Consortium DHCP Relay Agent";
@@ -73,9 +73,9 @@ diff -uNr dhcp-4.1.0.orig/relay/dhcrelay.c dhcp-4.1.0/relay/dhcrelay.c
} else if (!strcmp(argv[i], "-p")) {
if (++i == argc)
usage();
diff -uNr dhcp-4.1.0.orig/server/dhcpd.c dhcp-4.1.0/server/dhcpd.c
--- dhcp-4.1.0.orig/server/dhcpd.c 2009-07-08 20:53:54.518186738 +0200
+++ dhcp-4.1.0/server/dhcpd.c 2009-07-08 20:54:52.323721178 +0200
diff -uNr dhcp-4.1.0.ORIG/server/dhcpd.c dhcp-4.1.0/server/dhcpd.c
--- dhcp-4.1.0.ORIG/server/dhcpd.c 2009-07-09 15:29:40.000000000 +0100
+++ dhcp-4.1.0/server/dhcpd.c 2009-07-09 15:29:52.000000000 +0100
@@ -62,6 +62,9 @@
struct iaddr server_identifier;
int server_identifier_matched;

View File

@@ -3,8 +3,6 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init,v 1.5 2007/04/02 12:34:01 uberlord Exp $
opts="configtest"
DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd.conf}
depend() {
@@ -17,23 +15,6 @@ get_var() {
"${DHCPD_CHROOT}/${DHCPD_CONF}"
}
checkconfig() {
/usr/sbin/dhcpd -cf ${DHCPD_CHROOT}/${DHCPD_CONF} -t 1>/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
eerror "${SVCNAME} has detected a syntax error in your configuration files:"
/usr/sbin/dhcpd -cf ${DHCPD_CHROOT}/${DHCPD_CONF} -t
fi
return $ret
}
configtest() {
ebegin "Checking ${SVCNAME} configuration"
checkconfig
eend $?
}
start() {
# Work out our cffile if it's on our DHCPD_OPTS
case " ${DHCPD_OPTS} " in
@@ -51,8 +32,6 @@ start() {
return 1
fi
checkconfig || return 1
local leasefile="$(get_var lease-file-name)"
leasefile="${DHCPD_CHROOT}/${leasefile:-/var/lib/dhcp/dhcpd.leases}"
if [ ! -f "${leasefile}" ] ; then
@@ -70,8 +49,6 @@ start() {
local pidfile="$(get_var pid-file-name)"
pidfile="${pidfile:-/var/run/dhcp/dhcpd.pid}"
touch "${DHCPD_CHROOT}/${pidfile}"
chown dhcp:dhcp "${DHCPD_CHROOT}/${pidfile}"
ebegin "Starting ${DHCPD_CHROOT:+chrooted }${SVCNAME}"
start-stop-daemon --start --exec /usr/sbin/dhcpd \
@@ -86,8 +63,6 @@ start() {
stop() {
local chroot="$(get_options chroot)"
checkconfig || return 1
ebegin "Stopping ${chroot:+chrooted }${SVCNAME}"
start-stop-daemon --stop --exec /usr/sbin/dhcpd \

View File

@@ -0,0 +1,94 @@
#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init2,v 1.1 2009/07/09 14:45:22 chainsaw Exp $
opts="configtest"
DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd.conf}
depend() {
need net
use logger dns
}
get_var() {
sed -n 's/^[[:blank:]]\?'"$1"' "*\([^#";]\+\).*/\1/p' \
"${DHCPD_CHROOT}/${DHCPD_CONF}"
}
checkconfig() {
/usr/sbin/dhcpd -cf ${DHCPD_CHROOT}/${DHCPD_CONF} -t 1>/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
eerror "${SVCNAME} has detected a syntax error in your configuration files:"
/usr/sbin/dhcpd -cf ${DHCPD_CHROOT}/${DHCPD_CONF} -t
fi
return $ret
}
configtest() {
ebegin "Checking ${SVCNAME} configuration"
checkconfig
eend $?
}
start() {
# Work out our cffile if it's on our DHCPD_OPTS
case " ${DHCPD_OPTS} " in
*" -cf "*)
DHCPD_CONF=" ${DHCPD_OPTS} "
DHCPD_CONF="${DHCPD_CONF##* -cf }"
DHCPD_CONF="${DHCPD_CONF%% *}"
;;
*) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}"
;;
esac
if [ ! -f "${DHCPD_CHROOT}/${DHCPD_CONF}" ] ; then
eerror "${DHCPD_CHROOT}/${DHCPD_CONF} does not exist"
return 1
fi
checkconfig || return 1
local leasefile="$(get_var lease-file-name)"
leasefile="${DHCPD_CHROOT}/${leasefile:-/var/lib/dhcp/dhcpd.leases}"
if [ ! -f "${leasefile}" ] ; then
ebegin "Creating ${leasefile}"
touch "${leasefile}"
chown dhcp:dhcp "${leasefile}"
eend $? || return 1
fi
# Setup LD_PRELOAD so name resolution works in our chroot.
if [ -n "${DHCPD_CHROOT}" ] ; then
LD_PRELOAD="${LD_PRELOAD} /usr/lib/libresolv.so"
export LD_PRELOAD="${LD_PRELOAD} /usr/lib/libnss_dns.so"
fi
local pidfile="$(get_var pid-file-name)"
pidfile="${pidfile:-/var/run/dhcp/dhcpd.pid}"
ebegin "Starting ${DHCPD_CHROOT:+chrooted }${SVCNAME}"
start-stop-daemon --start --exec /usr/sbin/dhcpd \
--pidfile "${DHCPD_CHROOT}/${pidfile}" \
-- ${DHCPD_OPTS} -q -pf "${pidfile}" \
-user dhcp -group dhcp \
${DHCPD_CHROOT:+-chroot} ${DHCPD_CHROOT} ${DHCPD_IFACE}
eend $? \
&& save_options chroot "${DHCPD_CHROOT}" \
&& save_options pidfile "${pidfile}"
}
stop() {
local chroot="$(get_options chroot)"
checkconfig || return 1
ebegin "Stopping ${chroot:+chrooted }${SVCNAME}"
start-stop-daemon --stop --exec /usr/sbin/dhcpd \
--pidfile "${chroot}/$(get_options pidfile)"
eend $?
}