Bug 787318 - Link-local static routes installed with wrong scope
Link-local static routes installed with wrong scope
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Jiri Popelka
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-02-03 18:36 EST by jbash
Modified: 2012-05-03 03:23 EDT (History)
1 user (show)

See Also:
Fixed In Version: dhcp-4.2.3-8.P2.fc16
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-05-03 03:23:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Possible patch (943 bytes, patch)
2012-02-03 18:36 EST, jbash
no flags Details | Diff

  None (edit)
Description jbash 2012-02-03 18:36:52 EST
Created attachment 559383 [details]
Possible patch

Description of problem:

The fix for bug 769463 makes dhclient 4.2.3-6.P2 actually install static
interface routes (routes with next hops of, as provided by the
DHCP server. Apparently it didn't install them before.

However, it may be installing the routes with the wrong scope.

I have two overlaid IPv4 subnets on the same segment: and The DHCP server is capable of assigning addresses on
both subnets. In both cases, it always sends back a static route option
listing both subnets, with a next hop of for each.

dhclient-script installs both of these routes with global scope.  Since
the destination of one of them is identical to the link route that's
created when the interface comes up, it overwrites that link route.
So now we have something like this:

  [root@emergence jbash]# ip route show dev eth0  proto static                 # scope global dev eth0  scope link  metric 1002     # WHY would I want Avahi? dev eth0  proto static            # scope global

When dhclient then tries to install a default route via, the
kernel refuses. You can't install such a default route from the
command line, either:

  [root@emergence jbash]# ip route add default via
  RTNETLINK answers: No such process

However, if you fix the scope on the local link route, everything

  [root@emergence jbash]# ip route replace dev eth0
  [root@emergence jbash]# ip route add default via
  [root@emergence jbash]# ip route show
  default via dev eth0 dev eth0  scope link dev eth0  scope link  metric 1002 dev eth0  proto static 

I haven't been able to figure out for sure what a the scope of a route (as
opposed to a local address) is supposed to mean to the Linux kernel, but
I suspect that "scope link" means that the routed entities are directly
connected... in which case ANY route installed via DHCP with a
destination should have "scope link".

I can work around this on the DHCP server, so I'm not depending on
a fix personally, but I suspect the current behavior is still wrong.

Here's output from "ip monitor all" when an interface is brought up:

  [LINK]2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN 
      link/ether 00:24:7e:e1:60:1e brd ff:ff:ff:ff:ff:ff
  [ROUTE]ff00::/8 dev eth0  table local  metric 256 
  [ROUTE]fe80::/64 dev eth0  proto kernel  metric 256 
  [LINK]2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP 
      link/ether 00:24:7e:e1:60:1e brd ff:ff:ff:ff:ff:ff
  [ADDR]2: eth0    inet brd scope global eth0
  [ROUTE]local dev eth0  table local  proto kernel  scope host  src 
  [ROUTE]broadcast dev eth0  table local  proto kernel  scope link  src 
  [ROUTE] dev eth0  proto kernel  scope link  src 
  [ROUTE]broadcast dev eth0  table local  proto kernel  scope link  src 
  [ROUTE] dev eth0  proto static 
  [ROUTE] dev eth0  proto static 
  [ROUTE] dev eth0  scope link  metric 1002 
  [ADDR]2: eth0    inet6 fe80::224:7eff:fee1:601e/64 scope link 
         valid_lft forever preferred_lft forever
  [ROUTE]local fe80::224:7eff:fee1:601e via :: dev lo  table local  proto none  metric 0 

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

How reproducible:
Perfectly reproducible

Steps to Reproduce:
1. Install dhclient 4.2.3-6
2. Set up two overlaid subnets, say and
3. Have the DHCP server assign addresses in
4. Have the DHCP server return a static route list (option 121) like this:       via  via           via

   I use dnsmasq for this, and the option there is something like

Actual results:

Link routes installed with global scope, default route will not install.

Expected results:

Link routes installed with link scope, default route installed.
Comment 1 Jiri Popelka 2012-02-07 05:30:27 EST
Thank you for the investigation and patch !
Please test the following build:
Comment 2 jbash 2012-02-07 15:11:02 EST
Seems to work fine.
Comment 3 Fedora Update System 2012-04-17 07:06:18 EDT
dhcp-4.2.3-8.P2.fc16 has been submitted as an update for Fedora 16.
Comment 4 Fedora Update System 2012-04-18 15:42:25 EDT
Package dhcp-4.2.3-8.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-8.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-05-03 03:23:58 EDT
dhcp-4.2.3-8.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.