]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/rp-pppoe/discovery.c
Add pppoe-mac option to rp-pppoe plugin
[ppp.git] / pppd / plugins / rp-pppoe / discovery.c
index dc6148933248aab84869c7e652a52dcd93ce211e..6e25ae7361e9167b7f1ab01f58b4ba8e6d1d584c 100644 (file)
@@ -9,7 +9,7 @@
 ***********************************************************************/
 
 static char const RCSID[] =
-"$Id: discovery.c,v 1.5 2008/06/09 08:34:23 paulus Exp $";
+"$Id: discovery.c,v 1.6 2008/06/15 04:35:50 paulus Exp $";
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
@@ -274,7 +274,7 @@ sendPADI(PPPoEConnection *conn)
 *%DESCRIPTION:
 * Waits for a PADO packet and copies useful information
 ***********************************************************************/
-static void
+void
 waitForPADO(PPPoEConnection *conn, int timeout)
 {
     fd_set readable;
@@ -333,6 +333,11 @@ waitForPADO(PPPoEConnection *conn, int timeout)
                error("Ignoring PADO packet from non-unicast MAC address");
                continue;
            }
+           if (conn->req_peer
+               && memcmp(packet.ethHdr.h_source, conn->req_peer_mac, ETH_ALEN) != 0) {
+               warn("Ignoring PADO packet from wrong MAC address");
+               continue;
+           }
            if (parsePacket(&packet, parsePADOTags, &pc) < 0)
                return;
            if (conn->error)