netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem with talking to the kernel and iproute2/ifconfig
@ 2010-03-25 16:00 Paweł Staszewski
  2010-03-25 17:31 ` Patrick McHardy
  0 siblings, 1 reply; 4+ messages in thread
From: Paweł Staszewski @ 2010-03-25 16:00 UTC (permalink / raw)
  To: Linux Network Development list

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


And also weird thing is that on kernel 2.6.33.1

ip addr ls dev vlan0100
158: vlan0100@eth2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noqueue 
state DOWN qlen 100
     link/ether 00:30:48:67:fd:2e brd ff:ff:ff:ff:ff:ff

the same machine - the same interface but ifconfig use to list ip's
  ifconfig vlan0100
vlan0100  Link encap:Ethernet  HWaddr 00:30:48:67:fd:2e
           inet addr:10.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.248
           BROADCAST MULTICAST  MTU:1500  Metric:1
           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:100
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


The same machine - with the same script that loads gateways but on 
kernel 2.6.29.1
ip a ls dev vlan0100
8: vlan0100@eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc htb 
state UP qlen 100
     link/ether 00:30:48:d3:33:d6 brd ff:ff:ff:ff:ff:ff
     inet 10.0.0.1/29 brd 10.0.0.7 scope global vlan0100:1
     inet 10.0.0.25/29 brd 10.0.0.31 scope global vlan0100:2
     inet 10.0.0.49/29 brd 10.0.0.55 scope global vlan0100:3
     inet 10.0.0.121/29 brd 10.0.0.127 scope global vlan0100:4
     inet 10.0.0.129/29 brd 10.0.0.135 scope global vlan0100:5
     inet 10.0.0.153/29 brd 10.0.0.159 scope global vlan0100:6


Bests Regards
Paweł

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with talking to the kernel and iproute2/ifconfig
  2010-03-25 16:00 Problem with talking to the kernel and iproute2/ifconfig Paweł Staszewski
@ 2010-03-25 17:31 ` Patrick McHardy
  2010-03-25 17:52   ` Paweł Staszewski
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2010-03-25 17:31 UTC (permalink / raw)
  To: Paweł Staszewski; +Cc: Linux Network Development list

[-- 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)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Problem with talking to the kernel and iproute2/ifconfig
  2010-03-25 17:31 ` Patrick McHardy
@ 2010-03-25 17:52   ` Paweł Staszewski
  2010-03-26 16:42     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Paweł Staszewski @ 2010-03-25 17:52 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Linux Network Development list

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.
>
>    


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with talking to the kernel and iproute2/ifconfig
  2010-03-25 17:52   ` Paweł Staszewski
@ 2010-03-26 16:42     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-03-26 16:42 UTC (permalink / raw)
  To: pstaszewski; +Cc: kaber, netdev

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!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-26 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 16:00 Problem with talking to the kernel and iproute2/ifconfig Paweł Staszewski
2010-03-25 17:31 ` Patrick McHardy
2010-03-25 17:52   ` Paweł Staszewski
2010-03-26 16:42     ` David Miller

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).