From 9692c9c757b167bd13770bc01f1d307cd48b61d1 Mon Sep 17 00:00:00 2001 From: Jiří Popelka Date: Nov 23 2009 09:14:24 +0000 Subject: - Honor DEFROUTE=yes|no for all connection types (#530209) --- diff --git a/dhclient-script b/dhclient-script index cf904dd..3124e23 100755 --- a/dhclient-script +++ b/dhclient-script @@ -272,45 +272,45 @@ dhconfig() { . ${ETCDIR}/dhclient-up-hooks fi - if [[ (( -z "${GATEWAYDEV}" ) || - ( "${GATEWAYDEV}" = "${interface}" )) && - (( -z "$GATEWAY" ) || - (( -n "$DHCLIENT_IGNORE_GATEWAY" ) && - ( "$DHCLIENT_IGNORE_GATEWAY" = [Yy]* ))) ]]; then - metric="${METRIC:-}" - let i="${METRIC:-0}" - default_routers=() - - for router in ${new_routers} ; do - added_router=- - - for r in ${default_routers[@]} ; do - if [ "${r}" = "${router}" ]; then - added_router=1 + if [[ ( "${DEFROUTE}" != "no") && + (( -z "${GATEWAYDEV}" ) || + ( "${GATEWAYDEV}" = "${interface}" )) ]]; then + if [[ ( -z "$GATEWAY" ) || + (( -n "$DHCLIENT_IGNORE_GATEWAY" ) && + ( "$DHCLIENT_IGNORE_GATEWAY" = [Yy]* )) ]]; then + metric="${METRIC:-}" + let i="${METRIC:-0}" + default_routers=() + + for router in ${new_routers} ; do + added_router=- + + for r in ${default_routers[@]} ; do + if [ "${r}" = "${router}" ]; then + added_router=1 + fi + done + + if [ -z "${router}" ] || + [ "${added_router}" = "1" ] || + [ $(IFS=. ip2num ${router}) -le 0 ] || + [[ ( "${router}" = "${new_broadcast_address}" ) && + ( "${new_subnet_mask}" != "255.255.255.255" ) ]]; then + continue fi + + default_routers=(${default_routers[@]} ${router}) + add_default_gateway ${router} ${metric} + let i=i+1 + metric=${i} done + elif [ -n "${GATEWAY}" ]; then + routersubnet=$(mask ${GATEWAY} ${new_subnet_mask}) + mysubnet=$(mask ${new_ip_address} ${new_subnet_mask}) - if [ -z "${router}" ] || - [ "${added_router}" = "1" ] || - [ $(IFS=. ip2num ${router}) -le 0 ] || - [[ ( "${router}" = "${new_broadcast_address}" ) && - ( "${new_subnet_mask}" != "255.255.255.255" ) ]]; then - continue + if [ "${routersubnet}" = "${mysubnet}" ]; then + ip route replace default via ${GATEWAY} dev ${interface} fi - - default_routers=(${default_routers[@]} ${router}) - add_default_gateway ${router} ${metric} - let i=i+1 - metric=${i} - done - elif [[ (( -z "${GATEWAYDEV}" ) || - ( "${GATEWAYDEV}" = "${interface}" )) && - ( -n "${GATEWAY}" ) ]]; then - routersubnet=$(mask ${GATEWAY} ${new_subnet_mask}) - mysubnet=$(mask ${new_ip_address} ${new_subnet_mask}) - - if [ "${routersubnet}" = "${mysubnet}" ]; then - ip route replace default via ${GATEWAY} dev ${interface} fi fi diff --git a/dhcp.spec b/dhcp.spec index c1bb0c6..1e5711a 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -13,7 +13,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: %{basever}p1 -Release: 13%{?dist} +Release: 14%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -481,6 +481,9 @@ fi %attr(0644,root,root) %{_mandir}/man3/omapi.3.gz %changelog +* Mon Nov 23 2009 Jiri Popelka - 12:4.1.0p1-14 +- Honor DEFROUTE=yes|no for all connection types (#530209) + * Fri Oct 30 2009 Jiri Popelka - 12:4.1.0p1-13 - Make dhclient-script add IPv6 address to interface (#531997)