Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host-device temp interface name causes race conditions #1072

Open
champtar opened this issue Aug 13, 2024 · 2 comments · May be fixed by #1073
Open

host-device temp interface name causes race conditions #1072

champtar opened this issue Aug 13, 2024 · 2 comments · May be fixed by #1073

Comments

@champtar
Copy link
Contributor

Since #1002 the host-device plugin renames the interface before moving it.

This doesn't play too well with udev and NetworkManager, see https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1599

Would it be possible to use a temporary netns, ie move to a temp netns, rename, move to the dest ns ?
@adrianchiris FYI

@champtar
Copy link
Contributor Author

We can actually do the move + rename in 1 call, with the interface being up before the call

# ip link show eno4
71: eno4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether e4:43:4b:c0:d0:d3 brd ff:ff:ff:ff:ff:ff
    altname enp24s0f3
# ip netns add testns
# strace -f -yy -v -s1000 ip link set netns testns name testintf dev eno4
sendmsg(3<NETLINK:[ROUTE:303456]>, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=56, nlmsg_type=RTM_NEWLINK, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK, nlmsg_seq=1723584129, nlmsg_pid=0}, {ifi_family=AF_UNSPEC, ifi_type=ARPHRD_NETROM, ifi_index=if_nametoindex("eno4"), ifi_flags=0, ifi_change=0}, [[{nla_len=8, nla_type=IFLA_NET_NS_FD}, 4</run/netns/testns>], [{nla_len=13, nla_type=IFLA_IFNAME}, "testintf"]]], iov_len=56}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 56
# ip -n testns link
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
71: testintf: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether e4:43:4b:c0:d0:d3 brd ff:ff:ff:ff:ff:ff
    altname enp24s0f3

This is on RHEL 9.4, trying to find out when it was introduced

@champtar
Copy link
Contributor Author

Live rename is allowed since torvalds/linux@bd039b5 (and for some devices since torvalds/linux@8065a77)

@champtar champtar linked a pull request Aug 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant