diff mbox

Problem with talking to the kernel and iproute2/ifconfig

Message ID 4BAB9E02.2040605@trash.net
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Patrick McHardy March 25, 2010, 5:31 p.m. UTC
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.

Comments

Paweł Staszewski March 25, 2010, 5:52 p.m. UTC | #1
Yes
This patch resolve this problem and all is working now correctly.

cat gateways.conf | grep 'addr add' | wc -l
6267
ip -batch gateways.conf
ip a sh | grep ' 10.' | grep inet | wc -l
6267




W dniu 2010-03-25 18:31, Patrick McHardy pisze:
> 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.
>
>    

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller March 26, 2010, 4:42 p.m. UTC | #2
From: Paweł Staszewski <pstaszewski@itcare.pl>
Date: Thu, 25 Mar 2010 18:52:09 +0100

> This patch resolve this problem and all is working now correctly.

Patrick, since this is now tested to work, please make a formal
submission of this fix if you haven't already.

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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)