cleanup only let the old dhcp lcient with patch stay

Package-Manager: portage-2.2.0_alpha166
RepoMan-Options: --force
This commit is contained in:
Mario Fetka
2013-04-16 10:27:04 +02:00
parent 9cfa54a805
commit 8cc6ec160b
32 changed files with 53 additions and 5638 deletions

View File

@@ -1,205 +0,0 @@
diff -uNr dhcp-4.0.0.ORIG/client/scripts/bsdos dhcp-4.0.0/client/scripts/bsdos
--- dhcp-4.0.0.ORIG/client/scripts/bsdos 2008-09-01 13:22:40.000000000 +0100
+++ dhcp-4.0.0/client/scripts/bsdos 2008-09-01 13:23:24.000000000 +0100
@@ -95,6 +95,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
@@ -156,7 +159,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router >/dev/null 2>&1
@@ -213,7 +216,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
sleep 1
if [ "$new_routers" != "" ]; then
set $new_routers
diff -uNr dhcp-4.0.0.ORIG/client/scripts/freebsd dhcp-4.0.0/client/scripts/freebsd
--- dhcp-4.0.0.ORIG/client/scripts/freebsd 2008-09-01 13:22:40.000000000 +0100
+++ dhcp-4.0.0/client/scripts/freebsd 2008-09-01 13:23:24.000000000 +0100
@@ -139,6 +139,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
@@ -200,7 +203,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
$LOGGER "New IP Address ($interface): $new_ip_address"
$LOGGER "New Subnet Mask ($interface): $new_subnet_mask"
$LOGGER "New Broadcast Address ($interface): $new_broadcast_address"
@@ -264,7 +267,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
$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.0.0.ORIG/client/scripts/linux dhcp-4.0.0/client/scripts/linux
--- dhcp-4.0.0.ORIG/client/scripts/linux 2008-09-01 13:22:40.000000000 +0100
+++ dhcp-4.0.0/client/scripts/linux 2008-09-01 13:26:19.000000000 +0100
@@ -98,11 +98,6 @@
fi
fi
-release=`uname -r`
-release=`expr $release : '\(.*\)\..*'`
-relminor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
-relmajor=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
-
###
### DHCPv4 Handlers
###
@@ -125,6 +120,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
if [ x$reason = xMEDIUM ]; then
# Linux doesn't do mediums (ok, ok, media).
@@ -136,15 +134,7 @@
# Bring down alias interface. Its routes will disappear too.
ifconfig $interface:0- inet 0
fi
- if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] )
- then
- ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
- broadcast 255.255.255.255 up
- # Add route to make broadcast work. Do not omit netmask.
- route add default dev $interface netmask 0.0.0.0
- else
- ifconfig $interface 0 up
- fi
+ ifconfig $interface 0 up
# We need to give the kernel some time to get the interface up.
sleep 1
@@ -186,12 +176,14 @@
ifconfig $interface inet $new_ip_address $new_subnet_arg \
$new_broadcast_arg $mtu_arg
# Add a network route to the computed network address.
- if [ $relmajor -lt 2 ] || \
- ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
- route add -net $new_network_number $new_subnet_arg dev $interface
+ 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
- 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 ];
@@ -234,12 +226,15 @@
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
- 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.0.0.ORIG/client/scripts/netbsd dhcp-4.0.0/client/scripts/netbsd
--- dhcp-4.0.0.ORIG/client/scripts/netbsd 2008-09-01 13:22:40.000000000 +0100
+++ dhcp-4.0.0/client/scripts/netbsd 2008-09-01 13:23:33.000000000 +0100
@@ -95,6 +95,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
@@ -156,7 +159,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router >/dev/null 2>&1
@@ -213,7 +216,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
sleep 1
if [ "$new_routers" != "" ]; then
set $new_routers
diff -uNr dhcp-4.0.0.ORIG/client/scripts/solaris dhcp-4.0.0/client/scripts/solaris
--- dhcp-4.0.0.ORIG/client/scripts/solaris 2008-09-01 13:22:40.000000000 +0100
+++ dhcp-4.0.0/client/scripts/solaris 2008-09-01 13:23:33.000000000 +0100
@@ -78,6 +78,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
ifconfig=/sbin/ifconfig
@@ -140,7 +143,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
route add $new_ip_address 127.1 1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router 1 >/dev/null 2>&1
@@ -181,7 +184,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
sleep 1
set $new_routers
if ping -s -n -I 1 $1 64 1; then

View File

@@ -1,216 +0,0 @@
diff -uNr dhcp-4.0.0.ORIG/client/clparse.c dhcp-4.0.0/client/clparse.c
--- dhcp-4.0.0.ORIG/client/clparse.c 2008-09-01 11:38:51.000000000 +0100
+++ dhcp-4.0.0/client/clparse.c 2008-09-01 11:48:17.000000000 +0100
@@ -37,7 +37,7 @@
struct client_config top_level_config;
-#define NUM_DEFAULT_REQUESTED_OPTS 9
+#define NUM_DEFAULT_REQUESTED_OPTS 10
struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 1];
static void parse_client_default_duid(struct parse *cfile);
@@ -98,15 +98,20 @@
dhcp_universe.code_hash, &code, 0, MDL);
/* 8 */
- code = D6O_NAME_SERVERS;
+ code = DHO_NTP_SERVERS;
option_code_hash_lookup(&default_requested_options[7],
- dhcpv6_universe.code_hash, &code, 0, MDL);
+ dhcp_universe.code_hash, &code, 0, MDL);
/* 9 */
- code = D6O_DOMAIN_SEARCH;
+ code = D6O_NAME_SERVERS;
option_code_hash_lookup(&default_requested_options[8],
dhcpv6_universe.code_hash, &code, 0, MDL);
+ /* 10 */
+ code = D6O_DOMAIN_SEARCH;
+ option_code_hash_lookup(&default_requested_options[9],
+ dhcpv6_universe.code_hash, &code, 0, MDL);
+
for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) {
if (default_requested_options[code] == NULL)
log_fatal("Unable to find option definition for "
diff -uNr dhcp-4.0.0.ORIG/client/scripts/bsdos dhcp-4.0.0/client/scripts/bsdos
--- dhcp-4.0.0.ORIG/client/scripts/bsdos 2008-09-01 11:38:51.000000000 +0100
+++ dhcp-4.0.0/client/scripts/bsdos 2008-09-01 11:39:30.000000000 +0100
@@ -29,6 +29,26 @@
mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
fi
+ # If we're making confs, may as well make an ntp.conf too
+ make_ntp_conf
+}
+
+make_ntp_conf() {
+ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
+ if [ x$new_ntp_servers != x ]; then
+ conf="# Generated by dhclient for interface $interface\n"
+ conf="${conf}restrict default noquery notrust nomodify\n"
+ conf="${conf}restrict 127.0.0.1\n"
+ for ntpserver in $new_ntp_servers; do
+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
+ conf="${conf}server $ntpserver\n"
+ done
+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
+ conf="${conf}logfile /var/log/ntp.log\n"
+ printf "${conf}" > /etc/ntp.conf
+ chmod 644 /etc/ntp.conf
+ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
diff -uNr dhcp-4.0.0.ORIG/client/scripts/freebsd dhcp-4.0.0/client/scripts/freebsd
--- dhcp-4.0.0.ORIG/client/scripts/freebsd 2008-09-01 11:38:51.000000000 +0100
+++ dhcp-4.0.0/client/scripts/freebsd 2008-09-01 11:39:30.000000000 +0100
@@ -73,6 +73,26 @@
fi
fi
fi
+ # If we're making confs, may as well make an ntp.conf too
+ make_ntp_conf
+}
+
+make_ntp_conf() {
+ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
+ if [ "x$new_ntp_servers" != x ]; then
+ conf="# Generated by dhclient for interface $interface\n"
+ conf="${conf}restrict default noquery notrust nomodify\n"
+ conf="${conf}restrict 127.0.0.1\n"
+ for ntpserver in $new_ntp_servers; do
+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
+ conf="${conf}server $ntpserver\n"
+ done
+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
+ conf="${conf}logfile /var/log/ntp.log\n"
+ printf "${conf}" > /etc/ntp.conf
+ chmod 644 /etc/ntp.conf
+ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
diff -uNr dhcp-4.0.0.ORIG/client/scripts/linux dhcp-4.0.0/client/scripts/linux
--- dhcp-4.0.0.ORIG/client/scripts/linux 2008-09-01 11:38:51.000000000 +0100
+++ dhcp-4.0.0/client/scripts/linux 2008-09-01 11:39:30.000000000 +0100
@@ -55,6 +55,26 @@
mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
fi
+ # If we're making confs, may as well make an ntp.conf too
+ make_ntp_conf
+}
+
+make_ntp_conf() {
+ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
+ if [ "x$new_ntp_servers" != x ]; then
+ conf="# Generated by dhclient for interface $interface\n"
+ conf="${conf}restrict default noquery notrust nomodify\n"
+ conf="${conf}restrict 127.0.0.1\n"
+ for ntpserver in $new_ntp_servers; do
+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
+ conf="${conf}server $ntpserver\n"
+ done
+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
+ conf="${conf}logfile /var/log/ntp.log\n"
+ printf "${conf}" > /etc/ntp.conf
+ chmod 644 /etc/ntp.conf
+ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
diff -uNr dhcp-4.0.0.ORIG/client/scripts/netbsd dhcp-4.0.0/client/scripts/netbsd
--- dhcp-4.0.0.ORIG/client/scripts/netbsd 2008-09-01 11:38:51.000000000 +0100
+++ dhcp-4.0.0/client/scripts/netbsd 2008-09-01 11:39:30.000000000 +0100
@@ -29,6 +29,26 @@
mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
fi
+ # If we're making confs, may as well make an ntp.conf too
+ make_ntp_conf
+}
+
+make_ntp_conf() {
+ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
+ if [ "x$new_ntp_servers" != x ]; then
+ conf="# Generated by dhclient for interface $interface\n"
+ conf="${conf}restrict default noquery notrust nomodify\n"
+ conf="${conf}restrict 127.0.0.1\n"
+ for ntpserver in $new_ntp_servers; do
+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
+ conf="${conf}server $ntpserver\n"
+ done
+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
+ conf="${conf}logfile /var/log/ntp.log\n"
+ printf "${conf}" > /etc/ntp.conf
+ chmod 644 /etc/ntp.conf
+ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
diff -uNr dhcp-4.0.0.ORIG/client/scripts/openbsd dhcp-4.0.0/client/scripts/openbsd
--- dhcp-4.0.0.ORIG/client/scripts/openbsd 2008-09-01 11:38:51.000000000 +0100
+++ dhcp-4.0.0/client/scripts/openbsd 2008-09-01 11:39:30.000000000 +0100
@@ -29,6 +29,26 @@
mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
fi
+ # If we're making confs, may as well make an ntp.conf too
+ make_ntp_conf
+}
+
+make_ntp_conf() {
+ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
+ if [ "x$new_ntp_servers" != x ]; then
+ conf="# Generated by dhclient for interface $interface\n"
+ conf="${conf}restrict default noquery notrust nomodify\n"
+ conf="${conf}restrict 127.0.0.1\n"
+ for ntpserver in $new_ntp_servers; do
+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
+ conf="${conf}server $ntpserver\n"
+ done
+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
+ conf="${conf}logfile /var/log/ntp.log\n"
+ printf "${conf}" > /etc/ntp.conf
+ chmod 644 /etc/ntp.conf
+ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
diff -uNr dhcp-4.0.0.ORIG/client/scripts/solaris dhcp-4.0.0/client/scripts/solaris
--- dhcp-4.0.0.ORIG/client/scripts/solaris 2008-09-01 11:38:51.000000000 +0100
+++ dhcp-4.0.0/client/scripts/solaris 2008-09-01 11:39:30.000000000 +0100
@@ -17,6 +17,26 @@
mv /etc/resolv.conf.dhclient /etc/resolv.conf
fi
+ # If we're making confs, may as well make an ntp.conf too
+ make_ntp_conf
+}
+
+make_ntp_conf() {
+ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
+ if [ "x$new_ntp_servers" != x ]; then
+ conf="# Generated by dhclient for interface $interface\n"
+ conf="${conf}restrict default noquery notrust nomodify\n"
+ conf="${conf}restrict 127.0.0.1\n"
+ for ntpserver in $new_ntp_servers; do
+ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
+ conf="${conf}server $ntpserver\n"
+ done
+ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
+ conf="${conf}logfile /var/log/ntp.log\n"
+ printf "${conf}" > /etc/ntp.conf
+ chmod 644 /etc/ntp.conf
+ fi
+ fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.

View File

@@ -1,390 +0,0 @@
diff -ur a/client/scripts/bsdos b/client/scripts/bsdos
--- a/client/scripts/bsdos 2008-09-01 14:41:00.000000000 +0100
+++ b/client/scripts/bsdos 2008-09-01 14:57:33.000000000 +0100
@@ -1,34 +1,41 @@
#!/bin/sh
make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
if [ x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /etc/resolv.conf.dhclient
if [ "x$new_domain_search" != x ]; then
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_search}\n"
elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >> /etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
done
-
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- cat /dev/null > /etc/resolv.conf.dhclient6
- chmod 644 /etc/resolv.conf.dhclient6
-
if [ "x${new_dhcp6_domain_search}" != x ] ; then
- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
fi
for nameserver in ${new_dhcp6_name_servers} ; do
- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -ur a/client/scripts/freebsd b/client/scripts/freebsd
--- a/client/scripts/freebsd 2008-09-01 14:41:00.000000000 +0100
+++ b/client/scripts/freebsd 2008-09-01 15:00:18.000000000 +0100
@@ -11,68 +11,41 @@
fi
make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
if [ x"$new_domain_name_servers" != x ]; then
- ( cat /dev/null > /etc/resolv.conf.dhclient )
- exit_status=$?
- if [ $exit_status -ne 0 ]; then
- $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status"
- else
- if [ "x$new_domain_search" != x ]; then
- ( echo search $new_domain_search >> /etc/resolv.conf.dhclient )
- exit_status=$?
- elif [ "x$new_domain_name" != x ]; then
- # Note that the DHCP 'Domain Name Option' is really just a domain
- # name, and that this practice of using the domain name option as
- # a search path is both nonstandard and deprecated.
- ( echo search $new_domain_name >> /etc/resolv.conf.dhclient )
- exit_status=$?
- fi
- for nameserver in $new_domain_name_servers; do
- if [ $exit_status -ne 0 ]; then
- break
- fi
- ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient )
- exit_status=$?
- done
-
- # If there were no errors, attempt to mv the new file into place.
- if [ $exit_status -eq 0 ]; then
- ( mv /etc/resolv.conf.dhclient /etc/resolv.conf )
- exit_status=$?
- fi
-
- if [ $exit_status -ne 0 ]; then
- $LOGGER "Error while writing new /etc/resolv.conf."
- fi
+ if [ "x$new_domain_search" != x ]; then
+ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+ conf="${conf}search ${new_domain_name}\n"
fi
+ for nameserver in $new_domain_name_servers; do
+ conf="${conf}nameserver ${nameserver}\n"
+ done
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- ( cat /dev/null > /etc/resolv.conf.dhclient6 )
- exit_status=$?
- if [ $exit_status -ne 0 ] ; then
- $LOGGER "Unable to create /etc/resolv.conf.dhclient6: Error $exit_status"
- else
- if [ "x${new_dhcp6_domain_search}" != x ] ; then
- ( echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 )
- exit_status=$?
- fi
- for nameserver in ${new_dhcp6_name_servers} ; do
- if [ $exit_status -ne 0 ] ; then
- break
- fi
- ( echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 )
- exit_status=$?
- done
-
- if [ $exit_status -eq 0 ] ; then
- ( mv /etc/resolv.conf.dhclient6 /etc/resolv.conf )
- exit_status=$?
- fi
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ conf="${conf}nameserver ${nameserver}\n"
+ done
+ fi
- if [ $exit_status -ne 0 ] ; then
- $LOGGER "Error while writing new /etc/resolv.conf."
- fi
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -ur a/client/scripts/linux b/client/scripts/linux
--- a/client/scripts/linux 2008-09-01 14:41:00.000000000 +0100
+++ b/client/scripts/linux 2008-09-01 14:58:09.000000000 +0100
@@ -26,35 +26,41 @@
ip=/sbin/ip
make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
if [ x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /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
- elif [ x"$new_domain_name" != x ]; then
+ if [ "x$new_domain_search" != x ]; then
+ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
done
-
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- cat /dev/null > /etc/resolv.conf.dhclient6
- chmod 644 /etc/resolv.conf.dhclient6
-
if [ "x${new_dhcp6_domain_search}" != x ] ; then
- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
fi
for nameserver in ${new_dhcp6_name_servers} ; do
- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -ur a/client/scripts/netbsd b/client/scripts/netbsd
--- a/client/scripts/netbsd 2008-09-01 14:41:00.000000000 +0100
+++ b/client/scripts/netbsd 2008-09-01 14:58:40.000000000 +0100
@@ -1,34 +1,41 @@
#!/bin/sh
make_resolv_conf() {
- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /etc/resolv.conf.dhclient
- if [ "x$new_domain_search != x ]; then
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
- elif [ "x$new_domain_name != x ]; then
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+ if [ "x$new_domain_search" != x ]; then
+ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
done
-
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- cat /dev/null > /etc/resolv.conf.dhclient6
- chmod 644 /etc/resolv.conf.dhclient6
-
if [ "x${new_dhcp6_domain_search}" != x ] ; then
- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
fi
for nameserver in ${new_dhcp6_name_servers} ; do
- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -ur a/client/scripts/openbsd b/client/scripts/openbsd
--- a/client/scripts/openbsd 2008-09-01 14:41:00.000000000 +0100
+++ b/client/scripts/openbsd 2008-09-01 14:59:12.000000000 +0100
@@ -1,34 +1,41 @@
#!/bin/sh
make_resolv_conf() {
- if x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /etc/resolv.conf.dhclient
- if [ x"$new_domain_search" != x ]; then
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
- elif [ x"$new_domain_name" != x ]; then
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+ if [ "x$new_domain_search" != x ]; then
+ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
done
-
- mv /etc/ersolv.conf.dhclient /etc/resolv.conf
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- cat /dev/null > /etc/resolv.conf.dhclient6
- chmod 644 /etc/resolv.conf.dhclient6
-
if [ "x${new_dhcp6_domain_search}" != x ] ; then
- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
fi
for nameserver in ${new_dhcp6_name_servers} ; do
- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -ur a/client/scripts/solaris b/client/scripts/solaris
--- a/client/scripts/solaris 2008-09-01 14:41:00.000000000 +0100
+++ b/client/scripts/solaris 2008-09-01 14:59:27.000000000 +0100
@@ -1,22 +1,41 @@
#!/bin/sh
make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
if [ x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /etc/resolv.conf.dhclient
- if [ x"$new_domain_search" != x ]; then
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
- elif [ x"$new_domain_name" != x ]; then
+ if [ "x$new_domain_search" != x ]; then
+ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
+ done
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}

View File

@@ -1,48 +0,0 @@
diff -uNr dhcp-4.0.0.ORIG/client/scripts/linux dhcp-4.0.0/client/scripts/linux
--- dhcp-4.0.0.ORIG/client/scripts/linux 2008-09-03 00:52:41.000000000 +0100
+++ dhcp-4.0.0/client/scripts/linux 2008-09-03 00:53:16.000000000 +0100
@@ -258,7 +232,7 @@
### DHCPv6 Handlers
###
-if [ ${reason} = PREINIT6 ] ; then
+if [ x$reason = xPREINIT6 ] ; then
# Ensure interface is up.
${ip} link set ${interface} up
@@ -268,7 +242,7 @@
exit_with_hooks 0
fi
-if [ ${reason} = BOUND6 ] ; then
+if [ x$reason = xBOUND6 ] ; then
if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then
exit_with_hooks 2;
fi
@@ -282,7 +256,7 @@
exit_with_hooks 0
fi
-if [ ${reason} = RENEW6 ] || [ ${reason} = REBIND6 ] ; then
+if [ x$reason = xRENEW6 ] || [ x$reason} = xREBIND6 ] ; then
# Make sure nothing has moved around on us.
# Nameservers/domains/etc.
@@ -294,7 +268,7 @@
exit_with_hooks 0
fi
-if [ ${reason} = DEPREF6 ] ; then
+if [ x$reason = xDEPREF6 ] ; then
if [ x${new_ip6_prefixlen} = x ] ; then
exit_with_hooks 2;
fi
@@ -307,7 +281,7 @@
exit_with_hooks 0
fi
-if [ ${reason} = EXPIRE6 -o ${reason} = RELEASE6 -o ${reason} = STOP6 ] ; then
+if [ x$reason = xEXPIRE6 -o x$reason = xRELEASE6 -o x$reason = xSTOP6 ] ; then
if [ x${old_ip6_address} = x ] || [ x${old_ip6_prefixlen} = x ] ; then
exit_with_hooks 2;
fi

View File

@@ -1,115 +0,0 @@
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,25 +0,0 @@
diff -uNr dhcp-4.0.0.ORIG/common/socket.c dhcp-4.0.0/common/socket.c
--- dhcp-4.0.0.ORIG/common/socket.c 2008-09-02 10:25:21.000000000 +0100
+++ dhcp-4.0.0/common/socket.c 2008-09-02 10:27:29.000000000 +0100
@@ -46,6 +46,10 @@
#include <sys/uio.h>
#include <sys/uio.h>
+#ifdef HAVE_LINUX_IPV6_H
+#include <linux/ipv6.h>
+#endif
+
#ifdef USE_SOCKET_FALLBACK
# if !defined (USE_SOCKET_SEND)
# define if_register_send if_register_fallback
diff -uNr dhcp-4.0.0.ORIG/configure.ac dhcp-4.0.0/configure.ac
--- dhcp-4.0.0.ORIG/configure.ac 2008-09-02 10:25:21.000000000 +0100
+++ dhcp-4.0.0/configure.ac 2008-09-02 10:26:29.000000000 +0100
@@ -37,6 +37,7 @@
if test "$enable_dhcpv6" != "no"; then
AC_DEFINE([DHCPv6], [1],
[Define to 1 to include DHCPv6 support.])
+ AC_CHECK_HEADERS(linux/ipv6.h)
fi
###

View File

@@ -1,96 +0,0 @@
diff -uNr dhcp-4.0.0.ORIG/client/dhclient.c dhcp-4.0.0/client/dhclient.c
--- dhcp-4.0.0.ORIG/client/dhclient.c 2008-09-01 13:38:38.000000000 +0100
+++ dhcp-4.0.0/client/dhclient.c 2008-09-01 13:41:32.000000000 +0100
@@ -80,6 +80,8 @@
static isc_result_t write_duid(struct data_string *duid);
+extern int log_isc_blurb;
+
int
main(int argc, char **argv) {
int fd;
@@ -323,6 +325,7 @@
log_info ("%s", "");
} else {
log_perror = 0;
+ log_isc_blurb = 0;
quiet_interface_discovery = 1;
}
diff -uNr dhcp-4.0.0.ORIG/omapip/errwarn.c dhcp-4.0.0/omapip/errwarn.c
--- dhcp-4.0.0.ORIG/omapip/errwarn.c 2008-09-01 13:38:38.000000000 +0100
+++ dhcp-4.0.0/omapip/errwarn.c 2008-09-01 13:39:17.000000000 +0100
@@ -43,6 +43,8 @@
int log_perror = 1;
#endif
int log_priority;
+int log_isc_blurb=1;
+
void (*log_cleanup) (void);
#define CVT_BUF_MAX 1023
@@ -74,7 +76,9 @@
write (STDERR_FILENO, "\n", 1);
}
-#if !defined (NOMINUM)
+#if !defined(NOMINUM)
+ if ( log_isc_blurb )
+ {
log_error ("%s", "");
log_error ("If you did not get this software from ftp.isc.org, please");
log_error ("get the latest from ftp.isc.org and install that before");
@@ -92,7 +96,12 @@
log_error ("the README file.");
log_error ("%s", "");
log_error ("exiting.");
+ }else
+ {
+ log_error ("exiting.");
+ }
#endif
+
if (log_cleanup)
(*log_cleanup) ();
exit (1);
diff -uNr dhcp-4.0.0.ORIG/relay/dhcrelay.c dhcp-4.0.0/relay/dhcrelay.c
--- dhcp-4.0.0.ORIG/relay/dhcrelay.c 2008-09-01 13:38:38.000000000 +0100
+++ dhcp-4.0.0/relay/dhcrelay.c 2008-09-01 13:43:15.000000000 +0100
@@ -97,6 +97,7 @@
static char arr [] = "All rights reserved.";
static char message [] = "Internet Systems Consortium DHCP Relay Agent";
static char url [] = "For info, please visit http://www.isc.org/sw/dhcp/";
+extern int log_isc_blurb;
int
main(int argc, char **argv) {
@@ -163,6 +164,7 @@
} else if (!strcmp (argv [i], "-q")) {
quiet = 1;
quiet_interface_discovery = 1;
+ log_isc_blurb = 0;
} else if (!strcmp (argv [i], "-a")) {
add_agent_options = 1;
} else if (!strcmp (argv [i], "-c")) {
diff -uNr dhcp-4.0.0.ORIG/server/dhcpd.c dhcp-4.0.0/server/dhcpd.c
--- dhcp-4.0.0.ORIG/server/dhcpd.c 2008-09-01 13:38:38.000000000 +0100
+++ dhcp-4.0.0/server/dhcpd.c 2008-09-01 13:42:37.000000000 +0100
@@ -61,6 +61,9 @@
struct iaddr server_identifier;
int server_identifier_matched;
+
+extern int log_isc_blurb;
+
#if defined (NSUPDATE)
/* This stuff is always executed to figure the default values for certain
@@ -359,6 +362,7 @@
lftest = 1;
log_perror = -1;
} else if (!strcmp (argv [i], "-q")) {
+ log_isc_blurb = 0;
quiet = 1;
quiet_interface_discovery = 1;
#ifdef DHCPv6

View File

@@ -1,189 +0,0 @@
diff -uNr dhcp-4.0.0.ORIG/configure.ac dhcp-4.0.0/configure.ac
--- dhcp-4.0.0.ORIG/configure.ac 2008-09-02 10:57:37.000000000 +0100
+++ dhcp-4.0.0/configure.ac 2008-09-02 11:00:27.000000000 +0100
@@ -30,6 +30,17 @@
[Define to BIG_ENDIAN for MSB (Motorola or SPARC CPUs)
or LITTLE_ENDIAN for LSB (Intel CPUs).])
+# Paranoia/early chrooting is off by default
+AC_ARG_ENABLE(paranoia,
+ AC_HELP_STRING([--enable-paranoia],
+ [enable support for early chroot (default is no)]))
+if test "$enable_paranoia" != "no"; then
+ AC_DEFINE([PARANOIA], [1],
+ [Define to enable paranoia.])
+ AC_DEFINE([EARLY_CHROOT], [1],
+ [Define to 1 to chroot early.])
+fi
+
# DHCPv6 is off by default
AC_ARG_ENABLE(dhcpv6,
AC_HELP_STRING([--enable-dhcpv6],
diff -uNr dhcp-4.0.0.ORIG/server/dhcpd.c dhcp-4.0.0/server/dhcpd.c
--- dhcp-4.0.0.ORIG/server/dhcpd.c 2008-09-02 10:57:37.000000000 +0100
+++ dhcp-4.0.0/server/dhcpd.c 2008-09-02 10:57:54.000000000 +0100
@@ -46,6 +46,16 @@
#include <sys/types.h>
#include <signal.h>
+#if defined (PARANOIA)
+# include <sys/types.h>
+# include <unistd.h>
+# include <pwd.h>
+/* get around the ISC declaration of group */
+# define group real_group
+# include <grp.h>
+# undef group
+#endif /* PARANOIA */
+
static void usage(void);
struct iaddr server_identifier;
@@ -195,6 +205,21 @@
omapi_object_dereference (&listener, MDL);
}
+#if defined (PARANOIA)
+/* to be used in one of two possible scenarios */
+static void setup_chroot (char *chroot_dir) {
+ if (geteuid())
+ log_fatal ("you must be root to use chroot");
+ if (chroot(chroot_dir)) {
+ log_fatal ("chroot(\"%s\"): %m", chroot_dir);
+ }
+ if (chdir ("/")) {
+ /* probably permission denied */
+ log_fatal ("chdir(\"/\"): %m");
+ }
+}
+#endif /* PARANOIA */
+
#ifndef UNIT_TEST
int
main(int argc, char **argv) {
@@ -224,6 +249,14 @@
char *traceinfile = (char *)0;
char *traceoutfile = (char *)0;
#endif
+#if defined (PARANOIA)
+ char *set_user = 0;
+ char *set_group = 0;
+ char *set_chroot = 0;
+
+ uid_t set_uid = 0;
+ gid_t set_gid = 0;
+#endif /* PARANOIA */
/* Make sure that file descriptors 0 (stdin), 1, (stdout), and
2 (stderr) are open. To do this, we assume that when we
@@ -284,6 +317,20 @@
if (++i == argc)
usage ();
server = argv [i];
+#if defined (PARANOIA)
+ } else if (!strcmp (argv [i], "-user")) {
+ if (++i == argc)
+ usage ();
+ set_user = argv [i];
+ } else if (!strcmp (argv [i], "-group")) {
+ if (++i == argc)
+ usage ();
+ set_group = argv [i];
+ } else if (!strcmp (argv [i], "-chroot")) {
+ if (++i == argc)
+ usage ();
+ set_chroot = argv [i];
+#endif /* PARANOIA */
} else if (!strcmp (argv [i], "-cf")) {
if (++i == argc)
usage ();
@@ -438,6 +485,44 @@
trace_seed_stop, MDL);
#endif
+#if defined (PARANOIA)
+ /* get user and group info if those options were given */
+ if (set_user) {
+ struct passwd *tmp_pwd;
+
+ if (geteuid())
+ log_fatal ("you must be root to set user");
+
+ if (!(tmp_pwd = getpwnam(set_user)))
+ log_fatal ("no such user: %s", set_user);
+
+ set_uid = tmp_pwd->pw_uid;
+
+ /* use the user's group as the default gid */
+ if (!set_group)
+ set_gid = tmp_pwd->pw_gid;
+ }
+
+ if (set_group) {
+/* get around the ISC declaration of group */
+#define group real_group
+ struct group *tmp_grp;
+
+ if (geteuid())
+ log_fatal ("you must be root to set group");
+
+ if (!(tmp_grp = getgrnam(set_group)))
+ log_fatal ("no such group: %s", set_group);
+
+ set_gid = tmp_grp->gr_gid;
+#undef group
+ }
+
+# if defined (EARLY_CHROOT)
+ if (set_chroot) setup_chroot (set_chroot);
+# endif /* EARLY_CHROOT */
+#endif /* PARANOIA */
+
/* Default to the DHCP/BOOTP port. */
if (!local_port)
{
@@ -576,6 +661,10 @@
postconf_initialization (quiet);
+#if defined (PARANOIA) && !defined (EARLY_CHROOT)
+ if (set_chroot) setup_chroot (set_chroot);
+#endif /* PARANOIA && !EARLY_CHROOT */
+
/* test option should cause an early exit */
if (cftest && !lftest)
exit(0);
@@ -659,6 +748,22 @@
exit (0);
}
+#if defined (PARANOIA)
+ /* change uid to the specified one */
+
+ if (set_gid) {
+ if (setgroups (0, (void *)0))
+ log_fatal ("setgroups: %m");
+ if (setgid (set_gid))
+ log_fatal ("setgid(%d): %m", (int) set_gid);
+ }
+
+ if (set_uid) {
+ if (setuid (set_uid))
+ log_fatal ("setuid(%d): %m", (int) set_uid);
+ }
+#endif /* PARANOIA */
+
/* Read previous pid file. */
if ((i = open (path_dhcpd_pid, O_RDONLY)) >= 0) {
status = read(i, pbuf, (sizeof pbuf) - 1);
@@ -1039,6 +1144,10 @@
#else /* !DHCPv6 */
" [-cf config-file] [-lf lease-file]\n"
#endif /* DHCPv6 */
+#if defined (PARANOIA)
+ /* meld into the following string */
+ "\n [-user user] [-group group] [-chroot dir]"
+#endif /* PARANOIA */
#if defined (TRACING)
" [-tf trace-output-file]\n"
" [-play trace-input-file]\n"

View File

@@ -1,114 +0,0 @@
diff -uNr dhcp-4.0.1.ORIG/client/clparse.c dhcp-4.0.1/client/clparse.c
--- dhcp-4.0.1.ORIG/client/clparse.c 2009-03-30 13:54:47.000000000 +0100
+++ dhcp-4.0.1/client/clparse.c 2009-03-30 13:58:02.000000000 +0100
@@ -174,6 +174,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;
@@ -203,23 +207,13 @@
return status;
}
-int read_client_conf_file (const char *name, struct interface_info *ip,
+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 = NULL;
- status = new_parse(&cfile, file, NULL, 0, path_dhclient_conf, 0);
- if (status != ISC_R_SUCCESS || cfile == NULL)
- return status;
-
do {
token = peek_token (&val, (unsigned *)0, cfile);
if (token == END_OF_FILE)
@@ -230,10 +224,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>

View File

@@ -1,83 +0,0 @@
--- /usr/portage/net-misc/dhcp/dhcp-4.0.1.ebuild 2009-03-30 15:13:28.000000000 +0200
+++ dhcp-4.2.0.ebuild 2009-07-08 19:11:15.121631116 +0200
@@ -4,22 +4,30 @@
inherit eutils flag-o-matic autotools
+LDAP_PV="4.0.1-2.1"
+
MY_PV="${PV//_alpha/a}"
MY_PV="${MY_PV//_beta/b}"
MY_PV="${MY_PV//_rc/rc}"
MY_P="${PN}-${MY_PV}"
+MY_LDAP_PV="${LDAP_PV//-*/}"
+
DESCRIPTION="ISC Dynamic Host Configuration Protocol"
HOMEPAGE="http://www.isc.org/products/DHCP"
-SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+ ldap? ( http://dcantrel.fedorapeople.org/dhcp/ldap-patch/ldap-for-dhcp-${LDAP_PV}.tar.gz
+ http://ftp.disconnected-by-peer.at/pub/ldap-for-dhcp-${LDAP_PV}.tar.gz )"
LICENSE="isc-dhcp"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
-IUSE="doc ipv6 selinux kernel_linux vim-syntax"
+IUSE="doc ipv6 selinux kernel_linux vim-syntax ldap ssl"
DEPEND="selinux? ( sec-policy/selinux-dhcp )
kernel_linux? ( sys-apps/net-tools )
- vim-syntax? ( app-vim/dhcpd-syntax )"
+ vim-syntax? ( app-vim/dhcpd-syntax )
+ ldap? ( net-nds/openldap
+ ssl? ( dev-libs/openssl ) )"
PROVIDE="virtual/dhcpc"
@@ -65,6 +73,9 @@
# Add dbus support to dhclient
epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-dbus.patch
+ # Ldap patch for dhcp
+ epatch "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}/dhcp-${MY_LDAP_PV}"-ldap.patch
+
# Brand the version with Gentoo
# include revision if >0
local newver="Gentoo"
@@ -114,6 +125,8 @@
--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
--with-relay-pid-file=/var/run/dhcp/dhcrelay.pid \
$(use_enable ipv6 dhcpv6) \
+ $(use_with ldap) \
+ $(use_with ssl ldapcrypto) \
|| die
emake || die "compile problem"
@@ -138,8 +151,10 @@
newexe "${S}"/client/scripts/freebsd dhclient-script
fi
- use doc && dodoc README RELNOTES doc/*
-
+ if use doc; then
+ dodoc README RELNOTES doc/*
+ use ldap && dodoc "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/*.ldap "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/draft-ietf-dhc-ldap-schema-01.txt
+ fi
insinto /etc/dhcp
newins client/dhclient.conf dhclient.conf.sample
keepdir /var/{lib,run}/dhcp
@@ -152,6 +167,14 @@
newconfd "${FILESDIR}"/dhcpd.conf dhcpd
newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
+ # install ldap files
+ if use ldap; then
+ insinto /etc/openldap/schema
+ doins "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/dhcp.*
+ dosbin "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/dhcpd-conf-to-ldap
+ fi
+
+
# We never want portage to own this file
rm -f "${D}"/var/lib/dhcp/dhcpd.leases
}

View File

@@ -1,105 +0,0 @@
Submitted By: Mario Fetka (geos_one) (mario dot fetka at gmail dot com)
Date: 2010-02-14
Initial Package Version: 4.0.0
Origin: gentoo patch dhcp-4.0-no_isc_blurb.patch
Upstream Status:
Description:
diff -Naur dhcp-4.0.2.orig/client/dhclient.c dhcp-4.0.2/client/dhclient.c
--- dhcp-4.0.2.orig/client/dhclient.c 2010-02-14 07:26:37.018800468 +0000
+++ dhcp-4.0.2/client/dhclient.c 2010-02-14 07:26:44.163801138 +0000
@@ -80,6 +80,8 @@
static isc_result_t write_duid(struct data_string *duid);
+extern int log_isc_blurb;
+
int
main(int argc, char **argv) {
int fd;
@@ -325,6 +327,7 @@
log_info ("%s", "");
} else {
log_perror = 0;
+ log_isc_blurb = 0;
quiet_interface_discovery = 1;
}
diff -Naur dhcp-4.0.2.orig/omapip/errwarn.c dhcp-4.0.2/omapip/errwarn.c
--- dhcp-4.0.2.orig/omapip/errwarn.c 2010-02-14 07:26:37.006801498 +0000
+++ dhcp-4.0.2/omapip/errwarn.c 2010-02-14 07:26:44.164800970 +0000
@@ -43,6 +43,8 @@
int log_perror = 1;
#endif
int log_priority;
+int log_isc_blurb=1;
+
void (*log_cleanup) (void);
#define CVT_BUF_MAX 1023
@@ -74,7 +76,9 @@
IGNORE_RET (write (STDERR_FILENO, "\n", 1));
}
-#if !defined (NOMINUM)
+#if !defined(NOMINUM)
+ if ( log_isc_blurb )
+ {
log_error ("%s", "");
log_error ("If you did not get this software from ftp.isc.org, please");
log_error ("get the latest from ftp.isc.org and install that before");
@@ -92,7 +96,12 @@
log_error ("the README file.");
log_error ("%s", "");
log_error ("exiting.");
+ }else
+ {
+ log_error ("exiting.");
+ }
#endif
+
if (log_cleanup)
(*log_cleanup) ();
exit (1);
diff -Naur dhcp-4.0.2.orig/relay/dhcrelay.c dhcp-4.0.2/relay/dhcrelay.c
--- dhcp-4.0.2.orig/relay/dhcrelay.c 2010-02-14 07:26:37.014800648 +0000
+++ dhcp-4.0.2/relay/dhcrelay.c 2010-02-14 07:28:00.771800735 +0000
@@ -103,7 +103,8 @@
"Internet Systems Consortium DHCP Relay Agent";
static const char url[] =
"For info, please visit https://www.isc.org/software/dhcp/";
-
+extern int log_isc_blurb;
+
int
main(int argc, char **argv) {
int fd;
@@ -169,6 +170,7 @@
} else if (!strcmp (argv [i], "-q")) {
quiet = 1;
quiet_interface_discovery = 1;
+ log_isc_blurb = 0;
} else if (!strcmp (argv [i], "-a")) {
add_agent_options = 1;
} else if (!strcmp (argv [i], "-c")) {
diff -Naur dhcp-4.0.2.orig/server/dhcpd.c dhcp-4.0.2/server/dhcpd.c
--- dhcp-4.0.2.orig/server/dhcpd.c 2010-02-14 07:26:37.047800993 +0000
+++ dhcp-4.0.2/server/dhcpd.c 2010-02-14 07:26:44.165800803 +0000
@@ -62,6 +62,9 @@
struct iaddr server_identifier;
int server_identifier_matched;
+
+extern int log_isc_blurb;
+
#if defined (NSUPDATE)
/* This stuff is always executed to figure the default values for certain
@@ -354,6 +357,7 @@
lftest = 1;
log_perror = -1;
} else if (!strcmp (argv [i], "-q")) {
+ log_isc_blurb = 0;
quiet = 1;
quiet_interface_discovery = 1;
#ifdef DHCPv6

View File

@@ -1,189 +0,0 @@
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"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
@@ -163,7 +166,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router >/dev/null 2>&1
@@ -220,7 +223,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
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-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"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
@@ -173,7 +176,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
$LOGGER "New IP Address ($interface): $new_ip_address"
$LOGGER "New Subnet Mask ($interface): $new_subnet_mask"
$LOGGER "New Broadcast Address ($interface): $new_broadcast_address"
@@ -243,7 +246,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
$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-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
-release=`uname -r`
-release=`expr $release : '\(.*\)\..*'`
-relminor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
-relmajor=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
-
###
### DHCPv4 Handlers
###
@@ -131,6 +126,9 @@
if [ x$new_interface_mtu != x ]; then
mtu_arg="mtu $new_interface_mtu"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
if [ x$reason = xMEDIUM ]; then
# Linux doesn't do mediums (ok, ok, media).
@@ -142,15 +140,7 @@
# Bring down alias interface. Its routes will disappear too.
ifconfig $interface:0- inet 0
fi
- if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] )
- then
- ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
- broadcast 255.255.255.255 up
- # Add route to make broadcast work. Do not omit netmask.
- route add default dev $interface netmask 0.0.0.0
- else
- ifconfig $interface 0 up
- fi
+ ifconfig $interface 0 up
# We need to give the kernel some time to get the interface up.
sleep 1
@@ -192,15 +182,17 @@
ifconfig $interface inet $new_ip_address $new_subnet_arg \
$new_broadcast_arg $mtu_arg
# Add a network route to the computed network address.
- if [ $relmajor -lt 2 ] || \
- ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
- route add -net $new_network_number $new_subnet_arg dev $interface
+ 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
+ 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 ];
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"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
if [ x$reason = xMEDIUM ]; then
eval "ifconfig $interface $medium"
@@ -163,7 +166,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router >/dev/null 2>&1
@@ -220,7 +223,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
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-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"
fi
+if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+fi
ifconfig=/sbin/ifconfig
@@ -159,7 +162,7 @@
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
route add $new_ip_address 127.1 1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router 1 >/dev/null 2>&1
@@ -200,7 +203,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $mtu_arg $medium"
+ $new_broadcast_arg $mtu_arg $metric_arg $medium"
sleep 1
set $new_routers
if ping -s -n -I 1 $1 64 1; then

View File

@@ -1,395 +0,0 @@
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
Date: 2010-11-11
Initial Package Version: 4.1.2
Origin: gentoo dhcp-4.0-dhclient-resolvconf.patch
Upstream Status: unknown
Description: add dhconfig resolveconf support
diff -Naur dhcp-4.1.2.orig/client/scripts/bsdos dhcp-4.1.2/client/scripts/bsdos
--- dhcp-4.1.2.orig/client/scripts/bsdos 2010-11-11 19:44:00.000000000 +0000
+++ dhcp-4.1.2/client/scripts/bsdos 2010-11-11 19:44:06.000000000 +0000
@@ -1,34 +1,41 @@
#!/bin/sh
make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
if [ x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /etc/resolv.conf.dhclient
if [ "x$new_domain_search" != x ]; then
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_search}\n"
elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >> /etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
done
-
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- cat /dev/null > /etc/resolv.conf.dhclient6
- chmod 644 /etc/resolv.conf.dhclient6
-
if [ "x${new_dhcp6_domain_search}" != x ] ; then
- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
fi
for nameserver in ${new_dhcp6_name_servers} ; do
- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -Naur dhcp-4.1.2.orig/client/scripts/freebsd dhcp-4.1.2/client/scripts/freebsd
--- dhcp-4.1.2.orig/client/scripts/freebsd 2010-11-11 19:44:00.000000000 +0000
+++ dhcp-4.1.2/client/scripts/freebsd 2010-11-11 19:44:06.000000000 +0000
@@ -11,68 +11,41 @@
fi
make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
if [ x"$new_domain_name_servers" != x ]; then
- ( cat /dev/null > /etc/resolv.conf.dhclient )
- exit_status=$?
- if [ $exit_status -ne 0 ]; then
- $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status"
- else
- if [ "x$new_domain_search" != x ]; then
- ( echo search $new_domain_search >> /etc/resolv.conf.dhclient )
- exit_status=$?
- elif [ "x$new_domain_name" != x ]; then
- # Note that the DHCP 'Domain Name Option' is really just a domain
- # name, and that this practice of using the domain name option as
- # a search path is both nonstandard and deprecated.
- ( echo search $new_domain_name >> /etc/resolv.conf.dhclient )
- exit_status=$?
- fi
- for nameserver in $new_domain_name_servers; do
- if [ $exit_status -ne 0 ]; then
- break
- fi
- ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient )
- exit_status=$?
- done
-
- # If there were no errors, attempt to mv the new file into place.
- if [ $exit_status -eq 0 ]; then
- ( mv /etc/resolv.conf.dhclient /etc/resolv.conf )
- exit_status=$?
- fi
-
- if [ $exit_status -ne 0 ]; then
- $LOGGER "Error while writing new /etc/resolv.conf."
- fi
+ if [ "x$new_domain_search" != x ]; then
+ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+ conf="${conf}search ${new_domain_name}\n"
fi
+ for nameserver in $new_domain_name_servers; do
+ conf="${conf}nameserver ${nameserver}\n"
+ done
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- ( cat /dev/null > /etc/resolv.conf.dhclient6 )
- exit_status=$?
- if [ $exit_status -ne 0 ] ; then
- $LOGGER "Unable to create /etc/resolv.conf.dhclient6: Error $exit_status"
- else
- if [ "x${new_dhcp6_domain_search}" != x ] ; then
- ( echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 )
- exit_status=$?
- fi
- for nameserver in ${new_dhcp6_name_servers} ; do
- if [ $exit_status -ne 0 ] ; then
- break
- fi
- ( echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 )
- exit_status=$?
- done
-
- if [ $exit_status -eq 0 ] ; then
- ( mv /etc/resolv.conf.dhclient6 /etc/resolv.conf )
- exit_status=$?
- fi
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ conf="${conf}nameserver ${nameserver}\n"
+ done
+ fi
- if [ $exit_status -ne 0 ] ; then
- $LOGGER "Error while writing new /etc/resolv.conf."
- fi
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -Naur dhcp-4.1.2.orig/client/scripts/linux dhcp-4.1.2/client/scripts/linux
--- dhcp-4.1.2.orig/client/scripts/linux 2010-11-11 19:44:00.000000000 +0000
+++ dhcp-4.1.2/client/scripts/linux 2010-11-11 19:44:06.000000000 +0000
@@ -26,35 +26,41 @@
ip=/sbin/ip
make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
if [ x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /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
- elif [ x"$new_domain_name" != x ]; then
+ if [ "x$new_domain_search" != x ]; then
+ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
done
-
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- cat /dev/null > /etc/resolv.conf.dhclient6
- chmod 644 /etc/resolv.conf.dhclient6
-
if [ "x${new_dhcp6_domain_search}" != x ] ; then
- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
fi
for nameserver in ${new_dhcp6_name_servers} ; do
- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -Naur dhcp-4.1.2.orig/client/scripts/netbsd dhcp-4.1.2/client/scripts/netbsd
--- dhcp-4.1.2.orig/client/scripts/netbsd 2010-11-11 19:44:00.000000000 +0000
+++ dhcp-4.1.2/client/scripts/netbsd 2010-11-11 19:44:40.000000000 +0000
@@ -1,34 +1,41 @@
#!/bin/sh
make_resolv_conf() {
- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /etc/resolv.conf.dhclient
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
if [ "x$new_domain_search" != x ]; then
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_search}\n"
elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
done
-
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- cat /dev/null > /etc/resolv.conf.dhclient6
- chmod 644 /etc/resolv.conf.dhclient6
-
if [ "x${new_dhcp6_domain_search}" != x ] ; then
- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
fi
for nameserver in ${new_dhcp6_name_servers} ; do
- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -Naur dhcp-4.1.2.orig/client/scripts/openbsd dhcp-4.1.2/client/scripts/openbsd
--- dhcp-4.1.2.orig/client/scripts/openbsd 2010-11-11 19:44:00.000000000 +0000
+++ dhcp-4.1.2/client/scripts/openbsd 2010-11-11 19:44:06.000000000 +0000
@@ -1,34 +1,41 @@
#!/bin/sh
make_resolv_conf() {
- if x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /etc/resolv.conf.dhclient
- if [ x"$new_domain_search" != x ]; then
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
- elif [ x"$new_domain_name" != x ]; then
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+ if [ "x$new_domain_search" != x ]; then
+ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
done
-
- mv /etc/ersolv.conf.dhclient /etc/resolv.conf
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- cat /dev/null > /etc/resolv.conf.dhclient6
- chmod 644 /etc/resolv.conf.dhclient6
-
if [ "x${new_dhcp6_domain_search}" != x ] ; then
- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
fi
for nameserver in ${new_dhcp6_name_servers} ; do
- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}
diff -Naur dhcp-4.1.2.orig/client/scripts/solaris dhcp-4.1.2/client/scripts/solaris
--- dhcp-4.1.2.orig/client/scripts/solaris 2010-11-11 19:44:00.000000000 +0000
+++ dhcp-4.1.2/client/scripts/solaris 2010-11-11 19:44:06.000000000 +0000
@@ -1,22 +1,41 @@
#!/bin/sh
make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then
+ return 0
+ fi
+ local conf=
if [ x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /etc/resolv.conf.dhclient
- if [ x"$new_domain_search" != x ]; then
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
- elif [ x"$new_domain_name" != x ]; then
+ if [ "x$new_domain_search" != x ]; then
+ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
+ conf="${conf}search ${new_domain_name}\n"
fi
for nameserver in $new_domain_name_servers; do
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+ conf="${conf}nameserver ${nameserver}\n"
+ done
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ conf="${conf}nameserver ${nameserver}\n"
done
+ fi
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ if [ x"$conf" != x ]; then
+ conf="# Generated by dhclient or interface $interface\n${conf}"
+ if type resolvconf >/dev/null 2>&1; then
+ printf "${conf}" | resolvconf -a $interface
+ else
+ printf "${conf}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
fi
+
# If we're making confs, may as well make an ntp.conf too
make_ntp_conf
}

View File

@@ -1,96 +0,0 @@
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);
+extern int log_isc_blurb;
+
int
main(int argc, char **argv) {
int fd;
@@ -385,6 +387,7 @@
log_info("%s", "");
} else {
log_perror = 0;
+ log_isc_blurb = 0;
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-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
int log_priority;
+int log_isc_blurb=1;
+
void (*log_cleanup) (void);
#define CVT_BUF_MAX 1023
@@ -74,7 +76,9 @@
write (STDERR_FILENO, "\n", 1);
}
-#if !defined (NOMINUM)
+#if !defined(NOMINUM)
+ if ( log_isc_blurb )
+ {
log_error ("%s", "");
log_error ("If you did not get this software from ftp.isc.org, please");
log_error ("get the latest from ftp.isc.org and install that before");
@@ -92,7 +96,12 @@
log_error ("the README file.");
log_error ("%s", "");
log_error ("exiting.");
+ }else
+ {
+ log_error ("exiting.");
+ }
#endif
+
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-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";
static char url[] = "For info, please visit http://www.isc.org/sw/dhcp/";
+extern int log_isc_blurb;
#ifdef DHCPv6
#define DHCRELAY_USAGE \
@@ -219,6 +220,7 @@
} else if (!strcmp(argv[i], "-q")) {
quiet = 1;
quiet_interface_discovery = 1;
+ log_isc_blurb = 0;
} 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-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;
+
+extern int log_isc_blurb;
+
#if defined (NSUPDATE)
/* This stuff is always executed to figure the default values for certain
@@ -367,6 +370,7 @@
lftest = 1;
log_perror = -1;
} else if (!strcmp (argv [i], "-q")) {
+ log_isc_blurb = 0;
quiet = 1;
quiet_interface_discovery = 1;
#ifdef DHCPv6

View File

@@ -1,103 +0,0 @@
Submitted By: Mario Fetka (geos_one) (mario dot fetka at gmail dot com)
Date: 2010-02-14
Initial Package Version:
Origin: gentoo patch dhcp-4.1-no_isc_blurb.patch
Upstream Status:
Description:
diff -Naur dhcp-4.1.1.orig/client/dhclient.c dhcp-4.1.1/client/dhclient.c
--- dhcp-4.1.1.orig/client/dhclient.c 2010-02-14 07:43:04.825799868 +0000
+++ dhcp-4.1.1/client/dhclient.c 2010-02-14 07:43:20.842552286 +0000
@@ -89,6 +89,8 @@
static isc_result_t write_duid(struct data_string *duid);
+extern int log_isc_blurb;
+
int
main(int argc, char **argv) {
int fd;
@@ -387,6 +389,7 @@
log_info("%s", "");
} else {
log_perror = 0;
+ log_isc_blurb = 0;
quiet_interface_discovery = 1;
}
diff -Naur dhcp-4.1.1.orig/omapip/errwarn.c dhcp-4.1.1/omapip/errwarn.c
--- dhcp-4.1.1.orig/omapip/errwarn.c 2010-02-14 07:43:04.815800563 +0000
+++ dhcp-4.1.1/omapip/errwarn.c 2010-02-14 07:43:20.842552286 +0000
@@ -43,6 +43,8 @@
int log_perror = 1;
#endif
int log_priority;
+int log_isc_blurb=1;
+
void (*log_cleanup) (void);
#define CVT_BUF_MAX 1023
@@ -74,7 +76,9 @@
IGNORE_RET (write (STDERR_FILENO, "\n", 1));
}
-#if !defined (NOMINUM)
+#if !defined(NOMINUM)
+ if ( log_isc_blurb )
+ {
log_error ("%s", "");
log_error ("If you did not get this software from ftp.isc.org, please");
log_error ("get the latest from ftp.isc.org and install that before");
@@ -92,7 +96,12 @@
log_error ("the README file.");
log_error ("%s", "");
log_error ("exiting.");
+ }else
+ {
+ log_error ("exiting.");
+ }
#endif
+
if (log_cleanup)
(*log_cleanup) ();
exit (1);
diff -Naur dhcp-4.1.1.orig/relay/dhcrelay.c dhcp-4.1.1/relay/dhcrelay.c
--- dhcp-4.1.1.orig/relay/dhcrelay.c 2010-02-14 07:43:04.821800048 +0000
+++ dhcp-4.1.1/relay/dhcrelay.c 2010-02-14 07:43:44.269801278 +0000
@@ -133,6 +133,7 @@
"Internet Systems Consortium DHCP Relay Agent";
static const char url[] =
"For info, please visit https://www.isc.org/software/dhcp/";
+extern int log_isc_blurb;
#ifdef DHCPv6
#define DHCRELAY_USAGE \
@@ -222,6 +223,7 @@
} else if (!strcmp(argv[i], "-q")) {
quiet = 1;
quiet_interface_discovery = 1;
+ log_isc_blurb = 0;
} else if (!strcmp(argv[i], "-p")) {
if (++i == argc)
usage();
diff -Naur dhcp-4.1.1.orig/server/dhcpd.c dhcp-4.1.1/server/dhcpd.c
--- dhcp-4.1.1.orig/server/dhcpd.c 2010-02-14 07:43:04.841800124 +0000
+++ dhcp-4.1.1/server/dhcpd.c 2010-02-14 07:43:20.844551951 +0000
@@ -63,6 +63,9 @@
struct iaddr server_identifier;
int server_identifier_matched;
+
+extern int log_isc_blurb;
+
#if defined (NSUPDATE)
/* This stuff is always executed to figure the default values for certain
@@ -360,6 +363,7 @@
lftest = 1;
log_perror = -1;
} else if (!strcmp (argv [i], "-q")) {
+ log_isc_blurb = 0;
quiet = 1;
quiet_interface_discovery = 1;
#ifdef DHCPv6

View File

@@ -1,45 +0,0 @@
diff -uNr dhcp-4.2.0.orig//common/bpf.c dhcp-4.2.0/common/bpf.c
--- dhcp-4.2.0.orig//common/bpf.c 2010-08-24 21:05:43.000000000 +0200
+++ dhcp-4.2.0/common/bpf.c 2010-08-24 21:08:59.000000000 +0200
@@ -358,9 +358,9 @@
struct iovec iov [3];
int result;
- if (!strcmp (interface -> name, "fallback"))
+/* if (!strcmp (interface -> name, "fallback"))
return send_fallback (interface, packet, raw,
- len, from, to, hto);
+ len, from, to, hto); */
if (hto == NULL && interface->anycast_mac_addr.hlen)
hto = &interface->anycast_mac_addr;
@@ -537,7 +537,7 @@
void maybe_setup_fallback ()
{
- isc_result_t status;
+/* isc_result_t status;
struct interface_info *fbi = (struct interface_info *)0;
if (setup_fallback (&fbi, MDL)) {
if_register_fallback (fbi);
@@ -548,7 +548,7 @@
log_fatal ("Can't register I/O handle for %s: %s",
fbi -> name, isc_result_totext (status));
interface_dereference (&fbi, MDL);
- }
+ } */
}
void
diff -uNr dhcp-4.2.0.orig//includes/osdep.h dhcp-4.2.0/includes/osdep.h
--- dhcp-4.2.0.orig//includes/osdep.h 2010-08-24 21:05:43.000000000 +0200
+++ dhcp-4.2.0/includes/osdep.h 2010-08-24 21:06:07.000000000 +0200
@@ -157,7 +157,7 @@
Currently, all low-level packet interfaces use BSD sockets as a
fallback. */
-#if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \
+#if defined (USE_NIT_SEND) || \
defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || \
defined (USE_LPF_SEND) || \
(defined (USE_SOCKET_SEND) && defined (HAVE_SO_BINDTODEVICE))

View File

@@ -1,103 +0,0 @@
Submitted By: Your Name (your at email dot address)
Date: 2010-08-24
Initial Package Version: 4.1
Origin: Gentoo patch
Upstream Status: unknown
Description: remove isc blurb
diff -Naur dhcp-4.2.0.orig/client/dhclient.c dhcp-4.2.0/client/dhclient.c
--- dhcp-4.2.0.orig/client/dhclient.c 2010-08-24 19:00:10.000000000 +0000
+++ dhcp-4.2.0/client/dhclient.c 2010-08-24 19:00:35.000000000 +0000
@@ -89,6 +89,8 @@
static isc_result_t write_duid(struct data_string *duid);
+extern int log_isc_blurb;
+
int
main(int argc, char **argv) {
int fd;
@@ -408,6 +410,7 @@
log_info("%s", "");
} else {
log_perror = 0;
+ log_isc_blurb = 0;
quiet_interface_discovery = 1;
}
diff -Naur dhcp-4.2.0.orig/omapip/errwarn.c dhcp-4.2.0/omapip/errwarn.c
--- dhcp-4.2.0.orig/omapip/errwarn.c 2010-08-24 19:00:10.000000000 +0000
+++ dhcp-4.2.0/omapip/errwarn.c 2010-08-24 19:00:35.000000000 +0000
@@ -43,6 +43,8 @@
int log_perror = 1;
#endif
int log_priority;
+int log_isc_blurb=1;
+
void (*log_cleanup) (void);
#define CVT_BUF_MAX 1023
@@ -74,7 +76,9 @@
IGNORE_RET (write (STDERR_FILENO, "\n", 1));
}
-#if !defined (NOMINUM)
+#if !defined(NOMINUM)
+ if ( log_isc_blurb )
+ {
log_error ("%s", "");
log_error ("If you did not get this software from ftp.isc.org, please");
log_error ("get the latest from ftp.isc.org and install that before");
@@ -92,7 +96,12 @@
log_error ("the README file.");
log_error ("%s", "");
log_error ("exiting.");
+ }else
+ {
+ log_error ("exiting.");
+ }
#endif
+
if (log_cleanup)
(*log_cleanup) ();
exit (1);
diff -Naur dhcp-4.2.0.orig/relay/dhcrelay.c dhcp-4.2.0/relay/dhcrelay.c
--- dhcp-4.2.0.orig/relay/dhcrelay.c 2010-08-24 19:00:10.000000000 +0000
+++ dhcp-4.2.0/relay/dhcrelay.c 2010-08-24 19:01:47.000000000 +0000
@@ -133,6 +133,7 @@
"Internet Systems Consortium DHCP Relay Agent";
static const char url[] =
"For info, please visit https://www.isc.org/software/dhcp/";
+extern int log_isc_blurb;
#ifdef DHCPv6
#define DHCRELAY_USAGE \
@@ -228,6 +229,7 @@
} else if (!strcmp(argv[i], "-q")) {
quiet = 1;
quiet_interface_discovery = 1;
+ log_isc_blurb = 0;
} else if (!strcmp(argv[i], "-p")) {
if (++i == argc)
usage();
diff -Naur dhcp-4.2.0.orig/server/dhcpd.c dhcp-4.2.0/server/dhcpd.c
--- dhcp-4.2.0.orig/server/dhcpd.c 2010-08-24 19:00:10.000000000 +0000
+++ dhcp-4.2.0/server/dhcpd.c 2010-08-24 19:00:35.000000000 +0000
@@ -63,6 +63,9 @@
struct iaddr server_identifier;
int server_identifier_matched;
+
+extern int log_isc_blurb;
+
#if defined (NSUPDATE)
/* This stuff is always executed to figure the default values for certain
@@ -367,6 +370,7 @@
lftest = 1;
log_perror = -1;
} else if (!strcmp (argv [i], "-q")) {
+ log_isc_blurb = 0;
quiet = 1;
quiet_interface_discovery = 1;
#ifdef DHCPv6