[pkg-dhcp-commits] [SCM] ISC DHCP packaging for Debian branch, master, updated. debian/4.1.1-P1-16.1-34-gdf8dbf0

Andrew Pollock apollock at debian.org
Sat Aug 27 20:58:21 UTC 2011


The following commit has been merged in the master branch:
commit df8dbf0f5e8e3da331566863bf2a162c7e4af8ea
Author: Andrew Pollock <apollock at debian.org>
Date:   Sat Aug 27 13:57:46 2011 -0700

    fix metric calculation
    
    In the case of multiple routers for the default route, assign increasing metric
    values to them.  Depending whether IF_METRIC is set, the initial value is
    either $IF_METRIC or 1.
    
    This should fix bug #629632

diff --git a/debian/changelog b/debian/changelog
index cd2c9f3..9fa2c78 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,8 +31,10 @@ isc-dhcp (4.2.2-1) unstable; urgency=low
     comment in /etc/default/isc-dhcp-server (closes: #616417)
   * debian/control: apply patch from Peter Marschall to add a Provides:
     dhcp-client to isc-dhcp-client (closes: #236001)
+  * debian/dhclient-script.{linux,kfreebsd}: apply patch from Peter Marschall
+    to fix metric calculation (closes: #629632)
 
- -- Andrew Pollock <apollock at debian.org>  Sat, 27 Aug 2011 13:49:26 -0700
+ -- Andrew Pollock <apollock at debian.org>  Sat, 27 Aug 2011 13:56:44 -0700
 
 isc-dhcp (4.1.1-P1-18) unstable; urgency=low
 
diff --git a/debian/dhclient-script.linux b/debian/dhclient-script.linux
index 5bc9eac..2c054e7 100644
--- a/debian/dhclient-script.linux
+++ b/debian/dhclient-script.linux
@@ -152,9 +152,6 @@ fi
 if [ -z "$new_interface_mtu" ] || [ "$new_interface_mtu" -le 576 ]; then
     new_interface_mtu=''
 fi
-if [ -n "$IF_METRIC" ]; then
-    metric_arg="metric $IF_METRIC"	# interfaces(5), "metric" option
-fi
 
 
 # The action starts here
@@ -217,6 +214,12 @@ case "$reason" in
                 ip link set dev ${interface} mtu ${new_interface_mtu}
             fi
 
+            # set if_metric if IF_METRIC is set or there's more than one router
+            if_metric="$IF_METRIC"
+            if [ "${new_routers%% *}" != "${new_routers}" ]; then
+                if_metric=${if_metric:-1}
+            fi
+
             for router in $new_routers; do
                 if [ "$new_subnet_mask" = "255.255.255.255" ]; then
                     # point-to-point connection => set explicit route
@@ -225,7 +228,11 @@ case "$reason" in
 
                 # set default route
                 ip -4 route add default via ${router} dev ${interface} \
-                    ${metric_arg} >/dev/null 2>&1
+                    ${if_metric:+metric $if_metric} >/dev/null 2>&1
+
+                if [ -n "$if_metric" ]; then
+                    if_metric=$((if_metric+1))
+                fi
             done
         fi
 
@@ -289,10 +296,20 @@ case "$reason" in
                 ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
             fi
 
+            # set if_metric if IF_METRIC is set or there's more than one router
+            if_metric="$IF_METRIC"
+            if [ "${new_routers%% *}" != "${new_routers}" ]; then
+                if_metric=${if_metric:-1}
+            fi
+
             # set default route
             for router in $new_routers; do
                 ip -4 route add default via ${router} dev ${interface} \
-                    ${metric_arg} >/dev/null 2>&1
+                    ${if_metric:+metric $if_metric} >/dev/null 2>&1
+
+                if [ -n "$if_metric" ]; then
+                    if_metric=$((if_metric+1))
+                fi
             done
 
             # update /etc/resolv.conf

-- 
ISC DHCP packaging for Debian



More information about the pkg-dhcp-commits mailing list