From 2b4166d02ed0e5dd74d37e2229805ccfd3dc23e0 Mon Sep 17 00:00:00 2001 From: Xing Qingjie <88930741@qq.com> Date: Thu, 26 Nov 2020 06:09:38 -0500 Subject: [PATCH] Close discovery socket after session completed After the session is complete, the socket is left unmanaged. When the interface receives PADIs from other device, the packets is putting in the socket's Recv-Q, which eat system memory. [root@test ~]# ss -f link Netid Recv-Q Send-Q Local Address:Port Peer Address:Port p_raw 10269952 0 ppp_disc:eth1 * Signed-off-by: Xing Qingjie <88930741@qq.com> --- pppd/plugins/rp-pppoe/discovery.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pppd/plugins/rp-pppoe/discovery.c b/pppd/plugins/rp-pppoe/discovery.c index fd851de..23089df 100644 --- a/pppd/plugins/rp-pppoe/discovery.c +++ b/pppd/plugins/rp-pppoe/discovery.c @@ -659,6 +659,8 @@ discovery(PPPoEConnection *conn) } /* We're done. */ + close(conn->discoverySocket); + conn->discoverySocket = -1; conn->discoveryState = STATE_SESSION; return; } -- 2.39.2