- Honor DEFROUTE=yes|no for all connection types (#530209)

This commit is contained in:
Jiří Popelka 2009-11-23 09:14:24 +00:00
parent 9726e0ff9f
commit 9ca442a1dd
2 changed files with 37 additions and 34 deletions

View File

@ -272,45 +272,45 @@ dhconfig() {
. ${ETCDIR}/dhclient-up-hooks . ${ETCDIR}/dhclient-up-hooks
fi fi
if [[ (( -z "${GATEWAYDEV}" ) || if [[ ( "${DEFROUTE}" != "no") &&
( "${GATEWAYDEV}" = "${interface}" )) && (( -z "${GATEWAYDEV}" ) ||
(( -z "$GATEWAY" ) || ( "${GATEWAYDEV}" = "${interface}" )) ]]; then
(( -n "$DHCLIENT_IGNORE_GATEWAY" ) && if [[ ( -z "$GATEWAY" ) ||
( "$DHCLIENT_IGNORE_GATEWAY" = [Yy]* ))) ]]; then (( -n "$DHCLIENT_IGNORE_GATEWAY" ) &&
metric="${METRIC:-}" ( "$DHCLIENT_IGNORE_GATEWAY" = [Yy]* )) ]]; then
let i="${METRIC:-0}" metric="${METRIC:-}"
default_routers=() let i="${METRIC:-0}"
default_routers=()
for router in ${new_routers} ; do for router in ${new_routers} ; do
added_router=- added_router=-
for r in ${default_routers[@]} ; do for r in ${default_routers[@]} ; do
if [ "${r}" = "${router}" ]; then if [ "${r}" = "${router}" ]; then
added_router=1 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 fi
default_routers=(${default_routers[@]} ${router})
add_default_gateway ${router} ${metric}
let i=i+1
metric=${i}
done done
elif [ -n "${GATEWAY}" ]; then
routersubnet=$(mask ${GATEWAY} ${new_subnet_mask})
mysubnet=$(mask ${new_ip_address} ${new_subnet_mask})
if [ -z "${router}" ] || if [ "${routersubnet}" = "${mysubnet}" ]; then
[ "${added_router}" = "1" ] || ip route replace default via ${GATEWAY} dev ${interface}
[ $(IFS=. ip2num ${router}) -le 0 ] ||
[[ ( "${router}" = "${new_broadcast_address}" ) &&
( "${new_subnet_mask}" != "255.255.255.255" ) ]]; then
continue
fi 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
fi fi

View File

@ -13,7 +13,7 @@
Summary: Dynamic host configuration protocol software Summary: Dynamic host configuration protocol software
Name: dhcp Name: dhcp
Version: %{basever}p1 Version: %{basever}p1
Release: 13%{?dist} Release: 14%{?dist}
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
# dcantrell maintaining the package) made incorrect use of the epoch and # 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. # 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 %attr(0644,root,root) %{_mandir}/man3/omapi.3.gz
%changelog %changelog
* Mon Nov 23 2009 Jiri Popelka <jpopelka@redhat.com> - 12:4.1.0p1-14
- Honor DEFROUTE=yes|no for all connection types (#530209)
* Fri Oct 30 2009 Jiri Popelka <jpopelka@redhat.com> - 12:4.1.0p1-13 * Fri Oct 30 2009 Jiri Popelka <jpopelka@redhat.com> - 12:4.1.0p1-13
- Make dhclient-script add IPv6 address to interface (#531997) - Make dhclient-script add IPv6 address to interface (#531997)