From 8a1dcdb180e7e5486e4c9c0f81f02c5a03ec0b31 Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Fri, 28 Feb 2020 11:43:06 +0100 Subject: ifconfig: reset the ifindex when moving namespaces If you move an interface into a namespace where there is alreay an interface with the same index, the moved interface will get a new index assigned to it. We need to update our data structure accordingly. Signed-off-by: Simon Chopin --- accel-pppd/ifcfg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c index fbd11bf5..d9395478 100644 --- a/accel-pppd/ifcfg.c +++ b/accel-pppd/ifcfg.c @@ -319,6 +319,9 @@ int __export ap_session_rename(struct ap_session *ses, const char *ifname, int l } ses->net = ns; net = ns; + + /* Refresh the index now that it is in a new namespace */ + ses->ifindex = net->get_ifindex(ses->ifname); log_ppp_info2("move to namespace %s\n", ns->name); } -- cgit v1.2.3