netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* losing addresses if reusing interface names too fast
@ 2012-11-16 13:43 Jan Dvořák
  0 siblings, 0 replies; only message in thread
From: Jan Dvořák @ 2012-11-16 13:43 UTC (permalink / raw)
  To: netdev

Hello,

I have noticed a surprising behavior when removing virtual interfaces.
For example, removing a bridge with configured IP addresses and then
quickly creating another interface with identical name will cause the
addresses to be removed from the new interface a second or so later.

To demonstrate the issue:

brctl addbr foobar
ip addr add 10.20.30.40/24 dev foobar
ip addr show dev foobar

# 40: foobar: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
#     link/ether 12:12:f5:1b:c6:8e brd ff:ff:ff:ff:ff:ff
#     inet 10.20.30.40/24 scope global foobar

sleep 1

ip link set down dev foobar
brctl delbr foobar
ip link add name foobar link em1 type vlan id 42
ip addr add 10.20.30.40/24 dev foobar
ip addr show dev foobar

# 41: foobar@em1: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN
#     link/ether 00:21:cc:63:ec:3c brd ff:ff:ff:ff:ff:ff
#     inet 10.20.30.40/24 scope global foobar

sleep 3

ip addr show dev foobar
# 41: foobar@em1: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN
#     link/ether 00:21:cc:63:ec:3c brd ff:ff:ff:ff:ff:ff

ip link del foobar type vlan


If you monitor udev during course of this script, you will get following
sequence, spaces where sleeps were:

KERNEL[457506.286789] add      /devices/virtual/net/foobar (net)

KERNEL[457507.298630] remove   /devices/virtual/net/foobar (net)
KERNEL[457507.309597] add      /devices/virtual/net/foobar (net)

KERNEL[457510.324433] remove   /devices/virtual/net/foobar (net)


This means that I can't event wait for the bridge to get completely
removed, kernel tells me it's gone as soon as I delete it.

Could you please advise a workaround or confirm this as a bug?

Best regards,
	Jan Dvorak

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-16 14:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-16 13:43 losing addresses if reusing interface names too fast Jan Dvořák

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