From cf87269ef49d7f589f1f18c96e5795af8016bdf1 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Fri, 18 Mar 2016 15:33:30 +0300 Subject: ipoe: do not start second session on shared=0 interfaces --- accel-pppd/ctrl/ipoe/ipoe.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'accel-pppd/ctrl') 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); -- cgit v1.2.3