Bug 215715 - "ip route list table local" output loses the existing routes
"ip route list table local" output loses the existing routes
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Neil Horman
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-15 07:03 EST by Vasily Averin
Modified: 2008-01-09 12:29 EST (History)
5 users (show)

See Also:
Fixed In Version: RHBA-2007-0791
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 11:16:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
backport of the patch (528 bytes, patch)
2007-03-05 15:28 EST, Neil Horman
no flags Details | Diff

  None (edit)
Description Vasily Averin 2006-11-15 07:03:26 EST
SWsoft Virtuozzo/OpenVZ Linux Kernel Team has noticed that "ip route list table
local" output may lose the existing routes and it confuses the scripts parsing
its output.

This is kernel-related issue and it was fixed in mainstream by the following patch:
http://linux.bkbits.net:8080/linux-2.6/gnupatch@42221b0brjyLy6saMQrizii8Jx5kxQ

# ChangeSet
#   2005/02/27 11:10:03-08:00 davem@nuts.davemloft.net 
#   [IPV4]: Fix lost routes in fn_hash netlink dumps.
#   
#   Spotted by itkes@fat.imed.msu.ru, the fn_hash_dump_bucket() main
#   loop does not increment 'i' properly, and thus routes will not
#   be listed, when the test 'i < s_i' passes.
#   
#   The bug was added when the code was converted over to
#   hlist_for_each_entry() by your's truly.
#   
#   Signed-off-by: David S. Miller <davem@davemloft.net>

Version-Release number of selected component (if applicable):
2.6.9-42.0.3.EL

Steps to Reproduce:
add the new entries into local routing table until the issue occupies

[root@svconsole ~]# uname -a
Linux svconsole.sw.ru 2.6.9-42.0.3.ELsmp #1 SMP Mon Sep 25 17:28:02 EDT 2006
i686 i686 i386 GNU/Linux
[root@svconsole ~]# ip route list table local | wc -l
7

VVS@ comment: add 100 new entries into local table and inspect the number of
VVS@ comment: entries

[root@svconsole ~]#  for i in `seq 1 100` ; do ip r a local 10.1.240.$i dev eth0
proto kernel scope host src 10.1.240.$i ; done
[root@svconsole ~]# ip route list table local | wc -l
107

VVS@ comment: correct, as expected

[root@svconsole ~]#  for i in `seq 1 100` ; do ip r a local 10.2.240.$i dev eth0
proto kernel scope host src 10.2.240.$i || echo "ERROR" ; done
[root@svconsole ~]# ip route list table local | wc -l
207

VVS@ comment: correct again

[root@svconsole ~]#  for i in `seq 1 100` ; do ip r a local 10.3.240.$i dev eth0
proto kernel scope host src 10.3.240.$i || echo "ERROR" ; done
[root@svconsole ~]# ip route list table local | wc -l
304

VVS@ comment: wrong, should be 307 here!
Comment 2 Thomas Graf 2007-02-09 16:41:48 EST
The term "lost" is a bit misleading, none of the routes disappear or get lost.
The kernel fails to create multiple netlink messages to dump routes if the
total number of routes in a table exceed what can be carried in a single
netlink message. The netlink message size is limited by PAGE_SIZE, thus
results will be different on various archs.
Comment 3 David Miller 2007-02-09 18:01:42 EST
That's not what's happening here.

If you look at the patch the issue is simply not advancing the
iterator state properly in the dumping code.
Comment 4 Thomas Graf 2007-02-09 18:32:04 EST
I thought that's exactly what I wrote :-)
Comment 5 Neil Horman 2007-02-12 13:58:49 EST
Patch looks good to me.  Thanks!
Comment 6 RHEL Product and Program Management 2007-02-12 14:04:49 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 7 Neil Horman 2007-03-05 15:28:44 EST
Created attachment 149289 [details]
backport of the patch
Comment 8 RHEL Product and Program Management 2007-04-18 18:48:16 EDT
This request was evaluated by Red Hat Kernel Team for inclusion in a Red
Hat Enterprise Linux maintenance release, and has moved to bugzilla 
status POST.
Comment 9 Jason Baron 2007-05-23 14:36:30 EDT
committed in stream U6 build 55.4. A test kernel with this patch is available
from http://people.redhat.com/~jbaron/rhel4/
Comment 12 errata-xmlrpc 2007-11-15 11:16:22 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0791.html

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