]> git.ozlabs.org Git - ppp.git/commitdiff
Close discovery socket after session completed
authorXing Qingjie <88930741@qq.com>
Thu, 26 Nov 2020 11:09:38 +0000 (06:09 -0500)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 29 Dec 2020 03:08:22 +0000 (14:08 +1100)
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

index fd851def2fededf5f53bb64fd7681406ad598fcf..23089df550771f2a795c1e54b8d197b6bdc5e492 100644 (file)
@@ -659,6 +659,8 @@ discovery(PPPoEConnection *conn)
     }
 
     /* We're done. */
+    close(conn->discoverySocket);
+    conn->discoverySocket = -1;
     conn->discoveryState = STATE_SESSION;
     return;
 }