提交 cf87269e 编写于 作者: D Dmitry Kozlov

ipoe: do not start second session on shared=0 interfaces

上级 d9e66279
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册