* ip addr flush hangs
@ 2004-03-09 14:48 Olaf Kirch
2004-03-09 15:07 ` Olaf Kirch
0 siblings, 1 reply; 11+ messages in thread
From: Olaf Kirch @ 2004-03-09 14:48 UTC (permalink / raw)
To: netdev
Hi,
I'm currently debugging the following problem: on a 2.6.3
kernel, when doing this
ifconfig eth0 down
ip addr flush dev eth0
The second command hangs indefinitely. The reason is that the kernel
reports ipv6-all-hosts (ff02::1) when dumping all addresses, but
RTM_DELADDR on ff02::1 doesn't do anything. As /sbin/ip will loop until
the kernel reports no more matching addresses, it will go on like that
forever.
I don't see an obvious fix to this issue. On one hand, calling ifconfig
down will result in a call to addrconf_ifdown(dev, 0). This will clear
the list of unicast addresses assigned to this interface, but will not
clear the list of multicast addresses (it unloads them from the NIC,
and sends IGMP leave packets, but the list of addresses will remain
attached to the device). So it doesn't destroy the interface completely,
it zaps its state just partly, intentionally.
On the other hand, if you manually remove all addresses from the
interface, this will result in a call to addrconf_ifdown(dev, 1),
causing the mcast list to be zapped as well.
This is not entirely consistent. Should a NETDEV_DOWN zap the
ipv6 configuration completely?
Olaf
--
Olaf Kirch | Stop wasting entropy - start using predictable
okir@suse.de | tempfile names today!
---------------+
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ip addr flush hangs
2004-03-09 14:48 ip addr flush hangs Olaf Kirch
@ 2004-03-09 15:07 ` Olaf Kirch
2004-03-09 19:25 ` David S. Miller
2004-03-09 23:29 ` David S. Miller
0 siblings, 2 replies; 11+ messages in thread
From: Olaf Kirch @ 2004-03-09 15:07 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 654 bytes --]
On Tue, Mar 09, 2004 at 03:48:24PM +0100, Olaf Kirch wrote:
> This is not entirely consistent. Should a NETDEV_DOWN zap the
> ipv6 configuration completely?
Sorry to follow up on my own mail...
Cross-checking ipv4, I can see that it behaves the same way as IPv6
(i.e. NETDEV_DOWN partly leaves the interface configuration intact).
The difference though is that dump_ifaddr doesn't include multicast
addresses in its report.
The attached patch disables reporting of multicast and anycast
addresses in inet6_dump_ifaddr
Olaf
--
Olaf Kirch | Stop wasting entropy - start using predictable
okir@suse.de | tempfile names today!
---------------+
[-- Attachment #2: ipv6-netdev-down --]
[-- Type: text/plain, Size: 742 bytes --]
--- linux-2.6.3/net/ipv6/addrconf.c.orig 2004-03-09 15:46:33.000000000 +0100
+++ linux-2.6.3/net/ipv6/addrconf.c 2004-03-09 16:04:54.000000000 +0100
@@ -2898,6 +2898,11 @@ static int inet6_dump_ifaddr(struct sk_b
goto done;
}
#endif
+ /* You can't delete these via RTM_DELADDR, so we shouldn't
+ * display them here. Otherwise "ip addr flush" will loop
+ * forever trying to delete ff02::1 etc.
+ * --okir */
+#if 0
/* multicast address */
for (ifmca = idev->mc_list; ifmca;
ifmca = ifmca->next, ip_idx++) {
@@ -2918,6 +2923,7 @@ static int inet6_dump_ifaddr(struct sk_b
cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0)
goto done;
}
+#endif
read_unlock_bh(&idev->lock);
in6_dev_put(idev);
}
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: ip addr flush hangs
2004-03-09 15:07 ` Olaf Kirch
@ 2004-03-09 19:25 ` David S. Miller
2004-03-09 19:44 ` Andi Kleen
2004-03-09 19:47 ` Olaf Kirch
2004-03-09 23:29 ` David S. Miller
1 sibling, 2 replies; 11+ messages in thread
From: David S. Miller @ 2004-03-09 19:25 UTC (permalink / raw)
To: Olaf Kirch; +Cc: netdev
On Tue, 9 Mar 2004 16:07:30 +0100
Olaf Kirch <okir@suse.de> wrote:
> The attached patch disables reporting of multicast and anycast
> addresses in inet6_dump_ifaddr
Better to fix /sbin/ip, Andi Kleen posted a patch for that tool
in a thread on linux-kernel about this very issue.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ip addr flush hangs
2004-03-09 19:25 ` David S. Miller
@ 2004-03-09 19:44 ` Andi Kleen
2004-03-09 19:46 ` David S. Miller
2004-03-09 19:47 ` Olaf Kirch
1 sibling, 1 reply; 11+ messages in thread
From: Andi Kleen @ 2004-03-09 19:44 UTC (permalink / raw)
To: David S. Miller; +Cc: Olaf Kirch, netdev
On Tue, Mar 09, 2004 at 11:25:29AM -0800, David S. Miller wrote:
> On Tue, 9 Mar 2004 16:07:30 +0100
> Olaf Kirch <okir@suse.de> wrote:
>
> > The attached patch disables reporting of multicast and anycast
> > addresses in inet6_dump_ifaddr
>
> Better to fix /sbin/ip, Andi Kleen posted a patch for that tool
> in a thread on linux-kernel about this very issue.
The patch was buggy unfortunately - it fixed one case, but broke another.
Fixing the root cause like Olaf proposes is better.
-Andi
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ip addr flush hangs
2004-03-09 19:25 ` David S. Miller
2004-03-09 19:44 ` Andi Kleen
@ 2004-03-09 19:47 ` Olaf Kirch
1 sibling, 0 replies; 11+ messages in thread
From: Olaf Kirch @ 2004-03-09 19:47 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
On Tue, Mar 09, 2004 at 11:25:29AM -0800, David S. Miller wrote:
> > The attached patch disables reporting of multicast and anycast
> > addresses in inet6_dump_ifaddr
>
> Better to fix /sbin/ip, Andi Kleen posted a patch for that tool
> in a thread on linux-kernel about this very issue.
His patch breaks ip addr flush completely, because it breaks the loop
before flushing the RTM_DELADDR packet to the netlink socket.
Even if you fix it to break out ofthe loop in the proper place, it is
still not entirely correct. ip does addr list and addr flush in a loop,
because netlink can return only so many addresses in one packet. If you
break out of the loop unconditionally, as Andi does in his patch, you
break ip addr list/flush for systems with more than the normal number
of addresses per device.
I think IPv6 is really wrong in reporting multicast addresses via
RTM_GETADDR. IPv4 doesn't do this either.
Olaf
--
Olaf Kirch | Stop wasting entropy - start using predictable
okir@suse.de | tempfile names today!
---------------+
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ip addr flush hangs
2004-03-09 15:07 ` Olaf Kirch
2004-03-09 19:25 ` David S. Miller
@ 2004-03-09 23:29 ` David S. Miller
2004-03-09 23:56 ` Shirley Ma
1 sibling, 1 reply; 11+ messages in thread
From: David S. Miller @ 2004-03-09 23:29 UTC (permalink / raw)
To: Olaf Kirch; +Cc: netdev
On Tue, 9 Mar 2004 16:07:30 +0100
Olaf Kirch <okir@suse.de> wrote:
> The attached patch disables reporting of multicast and anycast
> addresses in inet6_dump_ifaddr
Applied, except I changed it to just remove the code entirely instead
of commenting it out.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ip addr flush hangs
2004-03-09 23:29 ` David S. Miller
@ 2004-03-09 23:56 ` Shirley Ma
2004-03-10 0:06 ` David S. Miller
2004-03-10 3:32 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 2 replies; 11+ messages in thread
From: Shirley Ma @ 2004-03-09 23:56 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, netdev-bounce, Olaf Kirch
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
Hi, Dave,
This fix causes a problem for SNMP IPv6 MIBs. It requires to dump all
interface
address types unicast/mcast/anycast. I would like suggest to fix the ip
command to fix the problem.
Thanks
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone: (503) 578-7638
FAX: (503) 578-3228
[-- Attachment #2: Type: text/html, Size: 411 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ip addr flush hangs
2004-03-09 23:56 ` Shirley Ma
@ 2004-03-10 0:06 ` David S. Miller
2004-03-10 3:32 ` YOSHIFUJI Hideaki / 吉藤英明
1 sibling, 0 replies; 11+ messages in thread
From: David S. Miller @ 2004-03-10 0:06 UTC (permalink / raw)
To: Shirley Ma; +Cc: netdev, netdev-bounce, okir
On Tue, 9 Mar 2004 15:56:00 -0800
Shirley Ma <xma@us.ibm.com> wrote:
> This fix causes a problem for SNMP IPv6 MIBs. It requires to dump all
> interface
> address types unicast/mcast/anycast. I would like suggest to fix the ip
> command to fix the problem.
We changed behavior which unexpectedly broke a pretty core tool
on everyone's system. I'm not reverting this.
Create instead a new rtnetlink command which can ask for xxx_cast
type addresses on an interface.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ip addr flush hangs
2004-03-09 23:56 ` Shirley Ma
2004-03-10 0:06 ` David S. Miller
@ 2004-03-10 3:32 ` YOSHIFUJI Hideaki / 吉藤英明
2004-03-10 7:59 ` Shirley Ma
1 sibling, 1 reply; 11+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-03-10 3:32 UTC (permalink / raw)
To: davem, netdev, xma; +Cc: okir, yoshfuji
In article <OF34091B26.07758A8E-ON87256E52.00833C04-88256E53.00004022@us.ibm.com> (at Tue, 9 Mar 2004 15:56:00 -0800), Shirley Ma <xma@us.ibm.com> says:
> This fix causes a problem for SNMP IPv6 MIBs. It requires to dump all
> interface
> address types unicast/mcast/anycast. I would like suggest to fix the ip
> command to fix the problem.
Grr... Putting anycast/multicast is not good idea.
(Sorry, I did not notice at that time...)
Anycast should use IFA_ANYCAST ifaddrmsg instead of IFA_ADDRESS.
Multicast should be provided in a different way (different rtmsg),
or use IFA_MULTICAST or something like that.
--yoshfuji
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ip addr flush hangs
2004-03-10 3:32 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2004-03-10 7:59 ` Shirley Ma
0 siblings, 0 replies; 11+ messages in thread
From: Shirley Ma @ 2004-03-10 7:59 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明
Cc: davem, netdev, okir, Hideaki YOSHIFUJI, yoshfuji
[-- Attachment #1.1: Type: text/plain, Size: 2227 bytes --]
OK, I will submit a patch for anycast and multicast addresses throught
different rtmsg.
Thanks
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone: (503) 578-7638
FAX: (503) 578-3228
YOSHIFUJI Hideaki
/ 吉藤英明
<yoshfuji@linux-i To
pv6.org> davem@redhat.com,
Sent by: "Hideaki netdev@oss.sgi.com, Shirley
YOSHIFUJI" Ma/Beaverton/IBM@IBMUS
<yoshfuji@cerberu cc
s.hongo.wide.ad.j okir@suse.de,
p> yoshfuji@linux-ipv6.org
Subject
Re: ip addr flush hangs
03/09/2004 07:32
PM
In article
<OF34091B26.07758A8E-ON87256E52.00833C04-88256E53.00004022@us.ibm.com> (at
Tue, 9 Mar 2004 15:56:00 -0800), Shirley Ma <xma@us.ibm.com> says:
> This fix causes a problem for SNMP IPv6 MIBs. It requires to dump all
> interface
> address types unicast/mcast/anycast. I would like suggest to fix the ip
> command to fix the problem.
Grr... Putting anycast/multicast is not good idea.
(Sorry, I did not notice at that time...)
Anycast should use IFA_ANYCAST ifaddrmsg instead of IFA_ADDRESS.
Multicast should be provided in a different way (different rtmsg),
or use IFA_MULTICAST or something like that.
--yoshfuji
[-- Attachment #1.2: Type: text/html, Size: 3553 bytes --]
[-- Attachment #2: graycol.gif --]
[-- Type: image/gif, Size: 105 bytes --]
[-- Attachment #3: pic27388.gif --]
[-- Type: image/gif, Size: 1255 bytes --]
[-- Attachment #4: ecblank.gif --]
[-- Type: image/gif, Size: 45 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2004-03-10 7:59 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-09 14:48 ip addr flush hangs Olaf Kirch
2004-03-09 15:07 ` Olaf Kirch
2004-03-09 19:25 ` David S. Miller
2004-03-09 19:44 ` Andi Kleen
2004-03-09 19:46 ` David S. Miller
2004-03-09 19:47 ` Olaf Kirch
2004-03-09 23:29 ` David S. Miller
2004-03-09 23:56 ` Shirley Ma
2004-03-10 0:06 ` David S. Miller
2004-03-10 3:32 ` YOSHIFUJI Hideaki / 吉藤英明
2004-03-10 7:59 ` Shirley Ma
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).