From: Xing Qingjie <88930741@qq.com> Date: Thu, 26 Nov 2020 11:09:38 +0000 (-0500) Subject: Close discovery socket after session completed X-Git-Tag: ppp-2.4.9~48 X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=2b4166d02ed0e5dd74d37e2229805ccfd3dc23e0;ds=sidebyside 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> --- 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; }