From 4e92627fc4e4e408b48b2ff62a1bd2713f6c95b9 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Tue, 7 Feb 2012 11:07:14 +0100 Subject: [PATCH] dhclient-script: install link-local static routes with correct scope (#787318) --- dhclient-script | 15 +++++++++++---- dhcp.spec | 5 ++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/dhclient-script b/dhclient-script index bba808e..da3db4f 100644 --- a/dhclient-script +++ b/dhclient-script @@ -406,9 +406,16 @@ dhconfig() { gateway=${static_routes[$i+1]} # special case 0.0.0.0 to allow static routing for link-local addresses - # (including IPv4 multicast) which will not have a next-hop (#769463) - if [ "${gateway}" = "0.0.0.0" ] || - is_router_reachable ${gateway}; then + # (including IPv4 multicast) which will not have a next-hop (#769463, #787318) + if [ "${gateway}" = "0.0.0.0" ]; then + valid_gateway=0 + scope='scope link' + else + is_router_reachable ${gateway} + valid_gateway=$? + scope='' + fi + if [ ${valid_gateway} -eq 0 ]; then metric='' for t in ${route_targets[@]}; do if [ ${t} = ${target} ]; then @@ -424,7 +431,7 @@ dhconfig() { metric="metric ${metric}" fi - ip -4 route replace ${target}/${prefix} proto static via ${gateway} dev ${interface} ${metric} + ip -4 route replace ${target}/${prefix} proto static via ${gateway} dev ${interface} ${metric} ${scope} if [ $? -ne 0 ]; then logmessage "failed to create static route: ${target}/${prefix} via ${gateway} dev ${interface} ${metric}" diff --git a/dhcp.spec b/dhcp.spec index 60bdbe1..d782a00 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -22,7 +22,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.2.3 -Release: 16.%{patchver}%{?dist} +Release: 17.%{patchver}%{?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. @@ -607,6 +607,9 @@ fi %changelog +* Tue Feb 07 2012 Jiri Popelka - 12:4.2.3-17.P2 +- dhclient-script: install link-local static routes with correct scope (#787318) + * Wed Feb 1 2012 Adam Williamson - 12:4.2.3-16.P2 - rebuild for new bind-libs-lite