net-misc/dhcp: bump to 4.1

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/mds@1351 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one
2009-07-08 19:09:13 +00:00
parent fbf2780b43
commit 6a9cb88d98
5 changed files with 556 additions and 1 deletions

View File

@@ -0,0 +1,211 @@
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
@@ -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-08 20:47:32.631747061 +0200
+++ dhcp-4.1.0/client/scripts/freebsd 2009-07-08 20:48:21.198858540 +0200
@@ -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-08 20:47:32.631747061 +0200
+++ dhcp-4.1.0/client/scripts/linux 2009-07-08 20:48:53.235881547 +0200
@@ -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
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
@@ -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-08 20:47:32.631747061 +0200
+++ dhcp-4.1.0/client/scripts/solaris 2009-07-08 20:48:21.203487631 +0200
@@ -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

@@ -0,0 +1,96 @@
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
@@ -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-08 20:53:54.573168693 +0200
+++ dhcp-4.1.0/omapip/errwarn.c 2009-07-08 20:54:52.318516628 +0200
@@ -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-08 20:53:54.543072262 +0200
+++ dhcp-4.1.0/relay/dhcrelay.c 2009-07-08 20:56:46.552266455 +0200
@@ -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-08 20:53:54.518186738 +0200
+++ dhcp-4.1.0/server/dhcpd.c 2009-07-08 20:54:52.323721178 +0200
@@ -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