From: Patrick McHardy <kaber@trash.net>
To: "Paweł Staszewski" <pstaszewski@itcare.pl>
Cc: Linux Network Development list <netdev@vger.kernel.org>
Subject: Re: Problem with talking to the kernel and iproute2/ifconfig
Date: Thu, 25 Mar 2010 18:31:46 +0100 [thread overview]
Message-ID: <4BAB9E02.2040605@trash.net> (raw)
In-Reply-To: <4BAB88A3.9070702@itcare.pl>
[-- Attachment #1: Type: text/plain, Size: 749 bytes --]
Paweł Staszewski wrote:
> Hello
>
> I have strange problem with kernel 2.6.33.1
>
> I have script with 6267 ip's
>
> cat gateways.conf | grep 'addr add' | wc -l
> 6267
>
> and when i want to commit this interfaces by command:
> ip -batch gateways.conf
>
> I have only 680 ip interfaces
> ip a | grep inet | grep ' 10.' | wc -l
> 680
>
>
> I test this on kernels 2.6.29.1 and 2.6.30.1 and all was OK.
> on kernel 2.6.29.1
>
> ip -batch gateways.conf
> ip a | grep inet | grep ' 10.' | wc -l
> 6267
>
> on kernel 2.6.30.1
> ip -batch gateways.conf
> ip a | grep inet | grep ' 10.' | wc -l
> 6267
Does this patch help? When "idx" points to the last device
of a chain, it will never get incremented past s_idx and we
fail to reset s_ip_idx.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 455 bytes --]
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 51ca946..3feb2b3 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1194,7 +1194,7 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
hlist_for_each_entry_rcu(dev, node, head, index_hlist) {
if (idx < s_idx)
goto cont;
- if (idx > s_idx)
+ if (h > s_h || idx > s_idx)
s_ip_idx = 0;
in_dev = __in_dev_get_rcu(dev);
if (!in_dev)
next prev parent reply other threads:[~2010-03-25 17:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-25 16:00 Problem with talking to the kernel and iproute2/ifconfig Paweł Staszewski
2010-03-25 17:31 ` Patrick McHardy [this message]
2010-03-25 17:52 ` Paweł Staszewski
2010-03-26 16:42 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BAB9E02.2040605@trash.net \
--to=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=pstaszewski@itcare.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).