From 57d5aa43123b8a8243e8e8e6971597afe352f9ed Mon Sep 17 00:00:00 2001 From: Gabriel Jeanneau Date: Thu, 13 Jan 2022 11:59:49 +0100 Subject: ppp_chan_read: check unit_hnd avoiding proto rej When receiving IPCP packet on channel handler, check unit handler to avoid sending a LCP Protocol Reject because ppp unit has not been created yet. This patch allows accel-ppp to handle higher pressure (handle 300 connections per second). Signed-off-by: Gabriel Jeanneau --- accel-pppd/ppp/ppp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index 49b53b1a..8a4cce7c 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -430,6 +430,11 @@ cont: } } + list_for_each_entry(ppp_h, &ppp->unit_handlers, entry) { + if (ppp_h->proto == proto) + goto cont; + } + lcp_send_proto_rej(ppp, proto); //log_ppp_warn("ppp_chan_read: discarding unknown packet %x\n", proto); } -- cgit v1.2.3