Bug 769463 - Classless Static Route with GW Fails
Classless Static Route with GW Fails
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jiri Popelka
Fedora Extras Quality Assurance
Depends On:
Blocks: 1527995
  Show dependency treegraph
Reported: 2011-12-20 17:28 EST by James Cape
Modified: 2017-12-20 12:50 EST (History)
1 user (show)

See Also:
Fixed In Version: dhcp-4.2.3-6.P2.fc16
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1527995 (view as bug list)
Last Closed: 2012-01-27 22:32:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description James Cape 2011-12-20 17:28:03 EST
Description of problem:

When providing a classless static route with a next-hop address, dhclient fails. Unfortunately, multicast routes *must* have an empty next-hop address otherwise Linux will send the frame to the gateway, rather than the group MAC address.

The exact issue is at line 430 of dhclient-script, which tests if a gateway is reachable. It should special-case out to allow static routing for link-local addresses (including IPv4 multicast) which will not have a next-hop. DHCPd does not reject these items.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Add option 121 to a server
2. Try to get a lease with option 121
Actual results:

Routes with a next-hop are not added.

Expected results:

Routes with a next-hop should be added as link-local/gateway-less routes.

Additional info:

Patch to dhclient-script:

--- /sbin/dhclient-script	2011-12-09 15:56:49.000000000 -0500
+++ dhclient-script	2011-12-20 17:12:46.002690685 -0500
@@ -427,7 +427,13 @@
-                if is_router_reachable ${gateway}; then
+		if [ "${gateway}" = "" ]; then
+			valid_gateway=0
+		else
+			is_router_reachable ${gateway}
+			valid_gateway=$?
+		fi
+                if [ ${valid_gateway} -eq 0 ]; then
                     for t in ${route_targets[@]}; do
                         if [ ${t} = ${target} ]; then
Comment 1 Jiri Popelka 2011-12-21 06:10:34 EST
Thanks. What about ?

diff --git a/dhclient-script b/dhclient-script
@@ -427,7 +427,8 @@ dhconfig() {
-                if is_router_reachable ${gateway}; then
+                if [ "${gateway}" = "" ] ||
+                   is_router_reachable ${gateway}; then
                     for t in ${route_targets[@]}; do
                         if [ ${t} = ${target} ]; then
Comment 2 James Cape 2011-12-21 06:28:43 EST
Looks like it will work. I've coiped/pasted the static routes section into /etc/dhcp/dhclient-up-hook (or whatever it's called), so I'll test with it later today.

Latest dhcpd can be used to test this by doing this:

scope ... {
  // static route for to
  option classless-static-routes 4.224;

should end up with:

$ ip route
... dev em2  proto static

on the client.
Comment 3 Fedora Update System 2012-01-23 10:28:18 EST
dhcp-4.2.3-6.P2.fc16 has been submitted as an update for Fedora 16.
Comment 4 Fedora Update System 2012-01-23 16:54:36 EST
Package dhcp-4.2.3-6.P2.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dhcp-4.2.3-6.P2.fc16'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 5 Fedora Update System 2012-01-27 22:32:00 EST
dhcp-4.2.3-6.P2.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.