Commit 8e15aee
net: move altnames together with the netdevice
The altname nodes are currently not moved to the new netns
when netdevice itself moves:
[ ~]# ip netns add test
[ ~]# ip -netns test link add name eth0 type dummy
[ ~]# ip -netns test link property add dev eth0 altname some-name
[ ~]# ip -netns test link show dev some-name
2: eth0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 1e:67:ed:19:3d:24 brd ff:ff:ff:ff:ff:ff
altname some-name
[ ~]# ip -netns test link set dev eth0 netns 1
[ ~]# ip link
...
3: eth0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 02:40:88:62:ec:b8 brd ff:ff:ff:ff:ff:ff
altname some-name
[ ~]# ip li show dev some-name
Device "some-name" does not exist.
Remove them from the hash table when device is unlisted
and add back when listed again.
Fixes: 36fbf1e ("net: rtnetlink: add linkprop commands to add and delete alternative ifnames")
Reviewed-by: Jiri Pirko <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>1 parent 1a83f4a commit 8e15aee
1 file changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
384 | 385 | | |
385 | 386 | | |
386 | 387 | | |
| |||
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
394 | 399 | | |
395 | 400 | | |
396 | 401 | | |
| |||
402 | 407 | | |
403 | 408 | | |
404 | 409 | | |
| 410 | + | |
405 | 411 | | |
406 | 412 | | |
407 | 413 | | |
408 | 414 | | |
409 | 415 | | |
410 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
411 | 420 | | |
412 | 421 | | |
413 | 422 | | |
| |||
10942 | 10951 | | |
10943 | 10952 | | |
10944 | 10953 | | |
10945 | | - | |
10946 | 10954 | | |
10947 | 10955 | | |
10948 | 10956 | | |
| |||
10970 | 10978 | | |
10971 | 10979 | | |
10972 | 10980 | | |
10973 | | - | |
10974 | | - | |
10975 | | - | |
10976 | 10981 | | |
10977 | 10982 | | |
10978 | 10983 | | |
| |||
0 commit comments