summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-03-18 15:33:30 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-03-18 15:33:30 +0300
commitcf87269ef49d7f589f1f18c96e5795af8016bdf1 (patch)
treeda06d539b558d01049aa28ae3170ba2a90f77314
parentd9e66279652a9e6639d5a82581bcc0fd7d999aff (diff)
downloadaccel-ppp-cf87269ef49d7f589f1f18c96e5795af8016bdf1.tar.gz
accel-ppp-cf87269ef49d7f589f1f18c96e5795af8016bdf1.zip
ipoe: do not start second session on shared=0 interfaces
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 49e32a7e..5e77c726 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -1784,9 +1784,7 @@ static struct ipoe_session *ipoe_session_create_up(struct ipoe_serv *serv, struc
triton_context_wakeup(&ses->ctx);
- //pthread_mutex_lock(&serv->lock);
list_add_tail(&ses->entry, &serv->sessions);
- //pthread_mutex_unlock(&serv->lock);
if (serv->timer.tpd)
triton_timer_del(&serv->timer);
@@ -1846,6 +1844,12 @@ void ipoe_recv_up(int ifindex, struct ethhdr *eth, struct iphdr *iph)
}
pthread_mutex_lock(&serv->lock);
+
+ if (!serv->opt_shared && !list_empty(&serv->sessions)) {
+ pthread_mutex_unlock(&serv->lock);
+ break;
+ }
+
list_for_each_entry(ses, &serv->sessions, entry) {
if (ses->yiaddr == iph->saddr) {
pthread_mutex_unlock(&serv->lock);
@@ -1853,10 +1857,11 @@ void ipoe_recv_up(int ifindex, struct ethhdr *eth, struct iphdr *iph)
return;
}
}
- pthread_mutex_unlock(&serv->lock);
ipoe_session_create_up(serv, eth, iph);
+ pthread_mutex_unlock(&serv->lock);
+
break;
}
pthread_mutex_unlock(&serv_lock);