Bug 787318 - Link-local static routes installed with wrong scope
Link-local static routes installed with wrong scope
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
16
All Linux
medium Severity low
: ---
: ---
Assigned To: Jiri Popelka
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2012-05-03 03:23:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 0.0.0.0), 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: 10.0.161.0/24 and
206.248.144.216/28. 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 0.0.0.0 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
  10.0.161.0/24 dev eth0  proto static                 # scope global
  169.254.0.0/16 dev eth0  scope link  metric 1002     # WHY would I want Avahi?
  206.248.144.208/28 dev eth0  proto static            # scope global

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

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

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

  [root@emergence jbash]# ip route replace 10.0.161.0/24 dev eth0
  [root@emergence jbash]# ip route add default via 10.0.161.1
  [root@emergence jbash]# ip route show
  default via 10.0.161.1 dev eth0 
  10.0.161.0/24 dev eth0  scope link 
  169.254.0.0/16 dev eth0  scope link  metric 1002 
  206.248.144.208/28 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 0.0.0.0
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 10.0.161.64/24 brd 10.0.161.255 scope global eth0
  [ROUTE]local 10.0.161.64 dev eth0  table local  proto kernel  scope host  src 10.0.161.64 
  [ROUTE]broadcast 10.0.161.255 dev eth0  table local  proto kernel  scope link  src 10.0.161.64 
  [ROUTE]10.0.161.0/24 dev eth0  proto kernel  scope link  src 10.0.161.64 
  [ROUTE]broadcast 10.0.161.0 dev eth0  table local  proto kernel  scope link  src 10.0.161.64 
  [ROUTE]10.0.161.0/24 dev eth0  proto static 
  [ROUTE]206.248.144.208/28 dev eth0  proto static 
  [ROUTE]169.254.0.0/16 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):
dhclient-4.2.3-6.P2.fc16.x86_64

How reproducible:
Perfectly reproducible

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

   10.0.161.0/24       via 0.0.0.0
   206.248.144.208/28  via 0.0.0.0
   0.0.0.0/0           via 206.248.144.217

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

   dhcp-option=lan,121,10.0.161.0/24,0.0.0.0,206.248.144.208/28,0.0.0.0,0.0.0.0/0,10.0.161.1
  
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:
http://koji.fedoraproject.org/koji/taskinfo?taskID=3768355
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.
https://admin.fedoraproject.org/updates/dhcp-4.2.3-8.P2.fc16
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:
https://admin.fedoraproject.org/updates/FEDORA-2012-6058/dhcp-4.2.3-8.P2.fc16
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.