]> git.ozlabs.org Git - ppp.git/commitdiff
Send PADT on PPPoE disconnect
authorSimon Farnsworth <simon@farnz.org.uk>
Sun, 1 Mar 2015 11:53:58 +0000 (11:53 +0000)
committerSimon Farnsworth <simon@farnz.org.uk>
Sun, 1 Mar 2015 11:53:58 +0000 (11:53 +0000)
Once we've terminated the PPP session, there is no chance of a PPP layer
disconnect. Some PPPoE relays don't detect the PPP session going down, and
depend on a long timeout or a PPPoE PADT to terminate the session.

Send a PADT on disconnect to work around these buggy relays.

Signed-off-by: Simon Farnsworth <simon@farnz.org.uk>
pppd/plugins/rp-pppoe/plugin.c

index a8c2bb4f4a6aec1cb76f30ebfa5403f852cc092f..90fb8089ad8f69590fe196cd9e9f49787809e574 100644 (file)
@@ -273,9 +273,10 @@ PPPOEDisconnectDevice(void)
                sizeof(struct sockaddr_pppox)) < 0)
        error("Failed to disconnect PPPoE socket: %d %m", errno);
     close(conn->sessionSocket);
                sizeof(struct sockaddr_pppox)) < 0)
        error("Failed to disconnect PPPoE socket: %d %m", errno);
     close(conn->sessionSocket);
-    /* don't send PADT?? */
-    if (conn->discoverySocket >= 0)
+    if (conn->discoverySocket >= 0) {
+        sendPADT(conn, NULL);
        close(conn->discoverySocket);
        close(conn->discoverySocket);
+    }
 }
 
 static void
 }
 
 static void