summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-05-28 13:07:01 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-05-28 13:07:01 +0300
commit829e5b573bb736cc17f0fbd3f680b74b5b6a4493 (patch)
tree36eb49496a96d430d2e4e8804ebeb685bef5d4c3
parent2f19bf6a0bccd8f0b5617ed99ff9efec5001a49a (diff)
downloadaccel-ppp-829e5b573bb736cc17f0fbd3f680b74b5b6a4493.tar.gz
accel-ppp-829e5b573bb736cc17f0fbd3f680b74b5b6a4493.zip
ipoe: do not bring interface down on session termination in shared=0 mode
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c3
-rw-r--r--accel-pppd/ifcfg.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 8bedfc47..b48e1f23 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -1244,6 +1244,9 @@ static int ipoe_session_terminate(struct ap_session *s, int hard)
{
struct ipoe_session *ses = container_of(s, typeof(*ses), ses);
+ if (ses->ifindex == -1)
+ ses->ctrl.dont_ifcfg = 1;
+
if (hard || !conf_soft_terminate || ses->UP || ap_shutdown)
ipoe_session_terminated(ses);
else
diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c
index 03968fb5..8fdfde7d 100644
--- a/accel-pppd/ifcfg.c
+++ b/accel-pppd/ifcfg.c
@@ -193,8 +193,9 @@ void __export ap_session_ifdown(struct ap_session *ses)
if (ses->ifindex == -1)
return;
+ strcpy(ifr.ifr_name, ses->ifname);
+
if (!ses->ctrl->dont_ifcfg) {
- strcpy(ifr.ifr_name, ses->ifname);
ifr.ifr_flags = 0;
net->sock_ioctl(SIOCSIFFLAGS, &ifr);
}