summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorSimon Chopin <s.chopin@alphalink.fr>2020-02-28 11:43:06 +0100
committerSimon Chopin <s.chopin@alphalink.fr>2020-03-18 09:07:38 +0100
commit8a1dcdb180e7e5486e4c9c0f81f02c5a03ec0b31 (patch)
tree76e87e5d3bde4f40f2eebf2b7d76a8f3daee98c7 /accel-pppd
parentf5b1c3f98bf082d4ecf57e8f2e3c61fc993d80e7 (diff)
downloadaccel-ppp-8a1dcdb180e7e5486e4c9c0f81f02c5a03ec0b31.tar.gz
accel-ppp-8a1dcdb180e7e5486e4c9c0f81f02c5a03ec0b31.zip
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 <s.chopin@alphalink.fr>
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ifcfg.c3
1 files changed, 3 insertions, 0 deletions
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);
}