diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2016-03-18 15:33:30 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2016-03-18 15:33:30 +0300 |
commit | cf87269ef49d7f589f1f18c96e5795af8016bdf1 (patch) | |
tree | da06d539b558d01049aa28ae3170ba2a90f77314 /accel-pppd/ctrl/ipoe/ipoe.c | |
parent | d9e66279652a9e6639d5a82581bcc0fd7d999aff (diff) | |
download | accel-ppp-cf87269ef49d7f589f1f18c96e5795af8016bdf1.tar.gz accel-ppp-cf87269ef49d7f589f1f18c96e5795af8016bdf1.zip |
ipoe: do not start second session on shared=0 interfaces
Diffstat (limited to 'accel-pppd/ctrl/ipoe/ipoe.c')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 11 |
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); |