summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2013-03-18 20:48:06 +0400
committerDmitry Kozlov <xeb@mail.ru>2013-03-18 20:48:06 +0400
commit88e90fd0812099807511152930a01035f6f3ce5a (patch)
treea5eb2f05b44692d17074a8a035a84d72f002077f
parent7a1b1120184e627a4465e5131e04e98b54e04f7d (diff)
downloadaccel-ppp-88e90fd0812099807511152930a01035f6f3ce5a.tar.gz
accel-ppp-88e90fd0812099807511152930a01035f6f3ce5a.zip
ipoe: fixed username=ifname, shared=0 mode
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c3
-rw-r--r--accel-pppd/ifcfg.c2
-rw-r--r--accel-pppd/session.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index ff183708..d971ce5e 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -331,6 +331,9 @@ static void ipoe_session_start(struct ipoe_session *ses)
struct unit_cache *uc;
if (!ses->ses.username) {
+ if (!ses->serv->opt_shared)
+ strncpy(ses->ses.ifname, ses->serv->ifname, AP_IFNAME_LEN);
+
ipoe_session_set_username(ses);
if (!ses->ses.username) {
diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c
index 296b354b..127d776d 100644
--- a/accel-pppd/ifcfg.c
+++ b/accel-pppd/ifcfg.c
@@ -184,7 +184,7 @@ void __export ap_session_ifdown(struct ap_session *ses)
struct in6_ifreq ifr6;
struct ipv6db_addr_t *a;
- if (ses->ctrl->dont_ifcfg)
+ if (ses->ctrl->dont_ifcfg || ses->ifindex == -1)
return;
memset(&ifr, 0, sizeof(ifr));
diff --git a/accel-pppd/session.c b/accel-pppd/session.c
index 22c27446..c04cdd25 100644
--- a/accel-pppd/session.c
+++ b/accel-pppd/session.c
@@ -267,6 +267,9 @@ int __export ap_session_read_stats(struct ap_session *ses, struct rtnl_link_stat
struct rtnl_link_stats lstats;
time_t t;
+ if (ses->ifindex == -1)
+ return -1;
+
if (!stats)
stats = &lstats;