Bug 878309

Summary: classless-static-routes default route generates assert
Product: [Fedora] Fedora Reporter: Scott Schmit <i.grok>
Component: NetworkManagerAssignee: Dan Williams <dcbw>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: danw, dcbw, roman.yepishev
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-05 13:09:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Scott Schmit 2012-11-20 04:35:29 UTC
Description of problem:
According to dhcp-options(5):
> This option (see RFC3442) specifies a list of classless static routes that
> the client should install in its routing cache.
> This option can contain one or more static routes, each of which consists of
> a destination descriptor and the IP address of the router that should be
> used to reach that destination.
>
> Many clients may not implement the Classless Static Routes option.  DHCP
> server administrators should therefore configure their DHCP servers to send
> both a Router option and a Classless Static Routes option, and should
> specify the default router(s) both in the Router option and in the
> Classless Static Routes option.
>
> If the DHCP server returns both a Classless Static Routes option and a
> Router option, the DHCP client ignores the Router option.

So, it should be expected to find a default route (prefix of 0) in the classless-static-routes option, and that route takes precedence over the router option.

From RFC 3442:
> If the DHCP server returns both a Classless Static Routes option and
> a Router option, the DHCP client MUST ignore the Router option.

Version-Release number of selected component (if applicable):
NetworkManager-0.9.6.4-1.fc17.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Set the classless-static-routes option on the dhcp server with some routes, including the default route.
2. Bring up an interface handled by that server
3. Take a look at the NM logs
  
Actual results:
Nov 19 17:44:45 <host> NetworkManager[555]: <info> (p3p1): DHCPv4 state changed preinit -> bound
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   address 192.168.2.5
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   prefix 22 (255.255.252.0)
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   classless static route 192.168.5.0/30 gw 192.168.0.254
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   classless static route 192.168.6.0/24 gw 192.168.0.13
Nov 19 17:44:45 <host> NetworkManager[555]: nm_ip4_route_set_prefix: assertion `prefix > 0' failed
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   gateway 192.168.0.9

Expected results:
Nov 19 17:44:45 <host> NetworkManager[555]: <info> (p3p1): DHCPv4 state changed preinit -> bound
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   address 192.168.2.5
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   prefix 22 (255.255.252.0)
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   classless static route 192.168.5.0/30 gw 192.168.0.254
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   classless static route 192.168.6.0/24 gw 192.168.0.13
Nov 19 17:44:45 <host> NetworkManager[555]: <info>   classless static route default gw 192.168.0.9

(i.e., no assertion failure, and the classless static route takes precedence over the router option)

Additional info:
the dhcp option on the server side:
option classless-static-routes 30.192.168.5.1 192.168.0.254, 24.192.168.6 192.168.0.13, 0 192.168.0.9;

Comment 1 Fedora End Of Life 2013-07-03 22:04:46 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Dan Williams 2013-07-22 19:33:59 UTC
This is a bug and should be fixed.

Comment 3 Scott Schmit 2013-07-23 00:42:24 UTC
I can still reproduce it on Fedora 18 / NetworkManager-0.9.8.1-3.git20130514.fc18.x86_64

Comment 4 Fedora End Of Life 2013-12-21 09:26:39 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2014-02-05 13:09:28 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.