From c4c85030efdba8a927bbca7f8b010a0152f823cb Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Fri, 28 Feb 2020 11:43:06 +0100 Subject: ppp: reset the ifindex when moving back to the default namespace 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/ppp/ppp.c | 1 + 1 file changed, 1 insertion(+) (limited to 'accel-pppd/ppp') diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index 0606f3f..49b53b1 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -280,6 +280,7 @@ static void destablish_ppp(struct ppp_t *ppp) } ppp->ses.net = def_net; net = def_net; + ppp->ses.ifindex = net->get_ifindex(ppp->ses.ifname); } sprintf(ifr.ifr_newname, "ppp%i", ppp->ses.unit_idx); -- cgit v1.2.3