[RP-PPPoE] A fix for PPPoE pass through feature

Murat Sezgin sezginmurat at gmail.com
Thu Nov 5 14:28:25 EST 2009


I am using the rp-pppoe-3.7 package in our open source router for
pppoe pass through feature. I am doing the Cdrouter tests. There are 2
tests for pppoe pass through in cdrouter. The first one is the basic
pass through connection establishment and our router passes this test.
But in the other test, the cdrouter sends a  packet with an unknown
destination MAC address and this packet is forwarded to the LAN side.
This packet is a PADT packet. In the relay.c file, in function
relayHandlePADT() there is not a packet destination address check,
only the session is checked and if the session is found the packet
passes. But in the other packet handler functions (PADO and PADS) and
the session packet handler function the destination MAC is also
checked. I think the destination MAC should also be checked in the
PADT handler function. When I add this check code the Cdrouter test
passes. The diff is as below. The rp-pppoe-3.10 package is also has
the same code with 3.7 version.

What do you think?

--- original_relay.c
+++ relay.c
@@ -954,7 +954,12 @@
     SessionHash *sh;
     PPPoESession *ses;
+    /* Ignore PADT packets whose destination address isn't ours */
+    if (memcmp(packet->ethHdr.h_dest, iface->mac, ETH_ALEN)) {
+             return;
+    }
     sh = findSession(packet->ethHdr.h_source, packet->session);
     if (!sh) {

Murat Sezgin

More information about the RP-PPPoE mailing list