diff options
author | Roy Marples <uberlord@gentoo.org> | 2006-05-10 12:57:04 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2006-05-10 12:57:04 +0000 |
commit | 760cfe2d2f32f7709909327564004894a1db7d68 (patch) | |
tree | 45947e75ccd95073f9786202cfcecef8fd4a76e5 /net-misc/dhcp | |
parent | Fix build_with_use typo from bug #132812 (diff) | |
download | gentoo-2-760cfe2d2f32f7709909327564004894a1db7d68.tar.gz gentoo-2-760cfe2d2f32f7709909327564004894a1db7d68.tar.bz2 gentoo-2-760cfe2d2f32f7709909327564004894a1db7d68.zip |
Tweak patches so that IF_METRIC is applied to the subnet route too.
(Portage version: 2.1_pre10-r5)
Diffstat (limited to 'net-misc/dhcp')
-rw-r--r-- | net-misc/dhcp/ChangeLog | 7 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch | 60 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch | 31 |
3 files changed, 78 insertions, 20 deletions
diff --git a/net-misc/dhcp/ChangeLog b/net-misc/dhcp/ChangeLog index abe6dea1130c..db1568c10edd 100644 --- a/net-misc/dhcp/ChangeLog +++ b/net-misc/dhcp/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-misc/dhcp # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.93 2006/05/09 16:09:22 uberlord Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.94 2006/05/10 12:57:04 uberlord Exp $ + + 10 May 2006; Roy Marples <uberlord@gentoo.org> + files/dhcp-3.0.3-dhclient-metric.patch, + files/dhcp-3.0.3-dhclient-no-down.patch: + Tweak patches so that IF_METRIC is applied to the subnet route too. 09 May 2006; Roy Marples <uberlord@gentoo.org> dhcp-3.0.4.ebuild: Correct location for default dhclient conf and pid files. diff --git a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch index b040a9bbfa3f..492cd56c329b 100644 --- a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch +++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-metric.patch @@ -60,7 +60,19 @@ $LOGGER "New Broadcast Address ($interface): $new_broadcast_address" --- client/scripts/linux +++ client/scripts/linux -@@ -106,6 +106,9 @@ +@@ -83,11 +83,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/'` +- + if [ x$new_broadcast_address != x ]; then + new_broadcast_arg="broadcast $new_broadcast_address" + fi +@@ -106,6 +101,9 @@ if [ x$new_interface_mtu != x ]; then mtu_arg="mtu $new_interface_mtu" fi @@ -70,8 +82,35 @@ if [ x$reason = xMEDIUM ]; then # Linux doesn't do mediums (ok, ok, media). -@@ -169,7 +172,7 @@ - route add -net $new_network_number $new_subnet_arg dev $interface +@@ -117,15 +115,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 +@@ -164,12 +154,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 [ $IF_METRIC -gt 0 ]; 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 @@ -79,8 +118,19 @@ done fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; -@@ -218,7 +221,7 @@ - route add -net $new_network_number +@@ -213,12 +205,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 [ $IF_METRIC -gt 0 ]; 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 diff --git a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch index d20406625657..518efec11c53 100644 --- a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch +++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch @@ -1,24 +1,18 @@ --- client/scripts/linux +++ client/scripts/linux -@@ -118,7 +118,7 @@ +@@ -118,9 +118,9 @@ if [ x$reason = xPREINIT ]; then if [ x$alias_ip_address != x ]; then # Bring down alias interface. Its routes will disappear too. - ifconfig $interface:0- inet 0 + ifconfig $interface:0- inet 0.0.0.0 fi - if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ) - then -@@ -127,7 +127,7 @@ - # 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 -+ ifconfig $interface 0.0.0.0 up - fi +- ifconfig $interface 0 up ++ ifconfig $interface 0.0.0.0 up # We need to give the kernel some time to get the interface up. -@@ -153,12 +153,12 @@ + sleep 1 +@@ -145,12 +145,12 @@ if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \ [ x$alias_ip_address != x$old_ip_address ]; then # Possible new alias. Remove old alias. @@ -33,7 +27,16 @@ fi if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ -@@ -189,11 +189,11 @@ +@@ -171,7 +171,7 @@ + fi + if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; + then +- ifconfig $interface:0- inet 0 ++ ifconfig $interface:0- inet 0.0.0.0 + ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg + route add -host $alias_ip_address $interface:0 + fi +@@ -183,11 +183,11 @@ || [ x$reason = xSTOP ]; then if [ x$alias_ip_address != x ]; then # Turn off alias interface. @@ -47,7 +50,7 @@ fi if [ x$alias_ip_address != x ]; then ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg -@@ -204,7 +204,7 @@ +@@ -198,7 +198,7 @@ if [ x$reason = xTIMEOUT ]; then if [ x$alias_ip_address != x ]; then @@ -56,7 +59,7 @@ fi ifconfig $interface inet $new_ip_address $new_subnet_arg \ $new_broadcast_arg $mtu_arg -@@ -226,7 +226,7 @@ +@@ -223,7 +223,7 @@ make_resolv_conf exit_with_hooks 0 fi |