Bug 1376347 - "ip route show cached" doesn't work but man page says it does?
Summary: "ip route show cached" doesn't work but man page says it does?
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: iproute
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Phil Sutter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-15 08:12 UTC by Cristian Morales Vega
Modified: 2017-03-21 16:50 UTC (History)
4 users (show)

Fixed In Version: iproute-4.4.0-4.fc24
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 16:50:40 UTC
Type: Bug


Attachments (Terms of Use)

Description Cristian Morales Vega 2016-09-15 08:12:15 UTC
I spent some time trying to find the cached ssthresh of a route and wondering why "ip route show cached" wasn't returning anything as it used to do.
I have found "ip tcp_metrics", which is fine. But if (and this is a big if) I get http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=89aef8921bfbac22f00e04f8450f6e447db13e42 right there is no cache table any more, so "ip route show cached" will never work?

The main problem is that "man ip-route" keeps having multiple references to the cache table.

* "cache - dump the routing cache."
* "cached list cloned routes i.e. routes which were dynamically forked from other routes because some route attribute (f.e. MTU) was updated.  Actually, it is equivalent to table cache"
* "a subsequent ip route ls cache, however, no packets are actually sent."

Comment 1 Phil Sutter 2016-09-20 20:46:39 UTC
Hi,

The mentioned kernel commit disables routing cache only for IPv4, IPv6 still has it. Subsequently, 'ip -6 route show cache' indeed shows cached routes (in case there are any).

For older kernels, the documentation is also correct and since iproute2 is supposed to be backwards compatible, I don't see much need to change it. We could add a note to the description of the 'cache' option though that since v3.10 it only affects IPv6 anymore.

Cheers, Phil

Comment 2 Cristian Morales Vega 2016-09-21 08:38:57 UTC
IMHO the note would be nice.
Also, I don't know the kernel interface, maybe there is no way for ip to know but, if possible, shouldn't "ip -4 route show cache" show some error message and return something other than zero when the running kernel doesn't support it?

Comment 3 Phil Sutter 2016-11-30 08:34:54 UTC
Hi Cristian,

(In reply to Cristian Morales Vega from comment #2)
> IMHO the note would be nice.

Patch submitted upstream: http://marc.info/?l=linux-netdev&m=148049460813798&w=2

> Also, I don't know the kernel interface, maybe there is no way for ip to
> know but, if possible, shouldn't "ip -4 route show cache" show some error
> message and return something other than zero when the running kernel doesn't
> support it?

I don't like this idea. It is not a mistake to list IPv4 route cache on newer systems, it's just empty. Having iproute bail here might confuse users checking the return code as they might think they got the syntax wrong or something. Also it might break existing scripts, which is a no go.

Cheers, Phil

Comment 4 Phil Sutter 2016-12-02 07:52:56 UTC
Patch accepted upstream:

commit f5f760b81250630da23a4021c30e802695be79d2
Author: Phil Sutter <phil>
Date:   Wed Nov 30 09:29:48 2016 +0100

    man: ip-route.8: Add notes about dropped IPv4 route cache
    
    Signed-off-by: Phil Sutter <phil>

Comment 5 Fedora Update System 2017-03-14 15:49:14 UTC
iproute-4.4.0-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-d92ee91481

Comment 6 Fedora Update System 2017-03-15 19:56:12 UTC
iproute-4.4.0-4.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-d92ee91481

Comment 7 Fedora Update System 2017-03-21 16:50:40 UTC
iproute-4.4.0-4.fc24 has been pushed to the Fedora 24 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.