[pkg-dhcp-commits] [SCM] ISC DHCP packaging for Debian branch, master, updated. debian/4.2.2.dfsg.1-5-7-g79efe98

Andrew Pollock apollock at debian.org
Thu Jun 21 03:56:25 UTC 2012


The following commit has been merged in the master branch:
commit 79efe98b68c9a40c9fb19830e76afd522ef0b266
Author: Andrew Pollock <apollock at debian.org>
Date:   Wed Jun 20 20:53:39 2012 -0700

    Ignore routers if rfc3442-classless-static-routes is present
    
    I've deliberately omitting making the equivalent change to the kfreebsd script
    because it looks subtly different and I can't test it as easily.
    
    These scripts desperately need to be cleaned up, rewritten and reunified.
    
    Bug: #592735

diff --git a/debian/changelog b/debian/changelog
index ceaffa0..5804be5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,9 @@ isc-dhcp (4.2.4-1) UNRELEASED; urgency=low
     incorporated into the non-LDAP build
   * debian/dhclient-script.*: conditionalise the chown/chmod of the new
     resolv.conf on the existence of the old one (closes: #595400)
+  * debian/dhclient-script.linux: comply with RFC 3442 and ignore
+    the routers option if the rfc3442-classless-static-routes option is present
+    (closes: #592735)
 
  -- Andrew Pollock <apollock at debian.org>  Sat, 09 Jun 2012 14:01:05 -0700
 
diff --git a/debian/dhclient-script.linux b/debian/dhclient-script.linux
index decd825..8510155 100644
--- a/debian/dhclient-script.linux
+++ b/debian/dhclient-script.linux
@@ -226,26 +226,30 @@ 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
-                    ip -4 route add ${router} dev $interface >/dev/null 2>&1
-                fi
-
-                # set default route
-                ip -4 route add default via ${router} dev ${interface} \
-                    ${if_metric:+metric $if_metric} >/dev/null 2>&1
-
-                if [ -n "$if_metric" ]; then
-                    if_metric=$((if_metric+1))
-                fi
-            done
+	    # if we have $new_rfc3442_classless_static_routes then we have to
+	    # ignore $new_routers entirely
+	    if [ ! "$new_rfc3442_classless_static_routers" ]; then
+		    # 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
+			    ip -4 route add ${router} dev $interface >/dev/null 2>&1
+			fi
+
+			# set default route
+			ip -4 route add default via ${router} dev ${interface} \
+			    ${if_metric:+metric $if_metric} >/dev/null 2>&1
+
+			if [ -n "$if_metric" ]; then
+			    if_metric=$((if_metric+1))
+			fi
+		    done
+	    fi
         fi
 
         if [ -n "$alias_ip_address" ] &&
@@ -301,29 +305,33 @@ case "$reason" in
 
         # if there is no router recorded in the lease or the 1st router answers pings
         if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}"; then
-            if [ -n "$alias_ip_address" ] &&
-               [ "$new_ip_address" != "$alias_ip_address" ]; then
-                # separate alias IP given => set up the alias IP & add host route to it
-                ip -4 addr add ${alias_ip_address}${alias_subnet_mask:+/$alias_subnet_mask} \
-                    dev ${interface} label ${interface}:0
-                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} \
-                    ${if_metric:+metric $if_metric} >/dev/null 2>&1
-
-                if [ -n "$if_metric" ]; then
-                    if_metric=$((if_metric+1))
-                fi
-            done
+	    # if we have $new_rfc3442_classless_static_routes then we have to
+	    # ignore $new_routers entirely
+	    if [ ! "$new_rfc3442_classless_static_routes" ]; then
+		    if [ -n "$alias_ip_address" ] &&
+		       [ "$new_ip_address" != "$alias_ip_address" ]; then
+			# separate alias IP given => set up the alias IP & add host route to it
+			ip -4 addr add ${alias_ip_address}${alias_subnet_mask:+/$alias_subnet_mask} \
+			    dev ${interface} label ${interface}:0
+			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} \
+			    ${if_metric:+metric $if_metric} >/dev/null 2>&1
+
+			if [ -n "$if_metric" ]; then
+			    if_metric=$((if_metric+1))
+			fi
+		    done
+	    fi
 
             # update /etc/resolv.conf
             make_resolv_conf

-- 
ISC DHCP packaging for Debian



More information about the pkg-dhcp-commits mailing list