Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1063254 - Default metric for ipv6 routes should be 1024
Summary: Default metric for ipv6 routes should be 1024
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: net-tools
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Jaromír Končický
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-10 11:29 UTC by David Gibson
Modified: 2014-07-01 22:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-17 09:09:00 UTC


Attachments (Terms of Use)
Patch (deleted)
2014-02-11 16:55 UTC, Jaromír Končický
no flags Details | Diff

Description David Gibson 2014-02-10 11:29:07 UTC
Description of problem:

At present the net-tools version of 'route', when adding ipv6 routes will default to creating them with metric 1.  In comparison iputils uses the kernel default metric of 1024, and routes the kernel creates from router advertisements have metric 256.

Routes created by net-tools route should not, by default, have higher priority than these.

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

net-tools-2.0-0.15.20131119git.fc20.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Create a dummy tun device with "tunctl -t testtun"
2. Obtain a private IPv6 address range, say fd42:6f3d:1cd0:a8cd::/64
3. Run:
        route -A inet6 add fd42:6f3d:1cd0:a8cd::/64 dev testtun
4. To check the route created, run:
        ip -6 route

Actual results:

Newly created route to fd42:6f3d:1cd0:a8cd::/64 has metric 1.

Expected results:

Newly created route should have default metric of 1024.

Additional info:

net-tools are deprecated, but this bug makes the transition bumpier, because old scripts which use "route" will tend to take precedence over those created with "ip route" due to the low metric.

Comment 1 Jaromír Končický 2014-02-11 16:55:06 UTC
Created attachment 861884 [details]
Patch

Here is a simple patch doing the job.
Setting metric to 0 (instead of 1024) seems to use kernel's default (as it is done in IPv4 version in inet_sr.c).
Note that the line can be removed at all, the structure is initially memset to zero.

Comment 2 Bernd Eckenfels 2014-02-12 21:36:17 UTC
David, Changing that default is somewhat dangerous. If somebody really uses route in boot scripts to set a manual route she expects the route to have higher presedence than the dynamically learned routes.

When I would do that new I might probably use the kernel default (or make the metric mandatory) and then new script authors know they have to specify a smaller metric. But since this is not new software I would rather not change the behaviour (even then "1" is a very unfortunate default, especually given that inet4 behaves different).

I dont see this is a big problem for migrating to iproute, since both allow specifying a manual metric number.

BTW: can you say something on the usecase? Is the metric actually used? I suspect that manual routes typically are more specific anyway so they are prefered. Are you concerned about this metric beeing broadcasted by some daemons or is it really the FIB suecase you noticed the inconsistency (I am asking because the route(1) man page states it is not used and I think thats not correct).

Jiri has commited the patch in upstream git, but I want to make sure it is safe to do so or at list very low probability of beeing a problem and high usefullness (which I dont see currently).

Comment 3 David Gibson 2014-02-17 07:37:33 UTC
Ah, I see your point regarding changing existing behaviour.

The situation I encountered this is with the "gogoc" IPv6 tunnel.  It uses a script to actually configure the routes around the tunnel, which is still based on "route" rather than ipconfig.  It doesn't explicitly specify a metric either, so the routes (including a default route) end up with metric 1 meaning they break existing native IPv6 connectivity if present.

I filed bug 1063272 about the problems on that end.

I'm happy enough to close this as CANTFIX.

Comment 4 Bernd Eckenfels 2014-02-17 21:28:02 UTC
Ok, I will add the default value to the man page, so it is documented.

Comment 5 David Gibson 2014-02-18 00:03:16 UTC
Bernd, thanks, sounds like the best we can do here.


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