From 5da0620c6bf4e3b87b1265b2ca49b767d53008d0 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 6 Dec 2009 10:14:46 +0000 Subject: [PATCH] Fixed checking input packet length (20 bytes is a valid packet and is used e.g. with MS RAS server) --- src/netif/ppp/ppp_oe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/netif/ppp/ppp_oe.c b/src/netif/ppp/ppp_oe.c index c34c529b..5a8a45cf 100644 --- a/src/netif/ppp/ppp_oe.c +++ b/src/netif/ppp/ppp_oe.c @@ -398,7 +398,7 @@ pppoe_dispatch_disc_pkt(struct netif *netif, struct pbuf *pb) #endif struct pppoehdr *ph; struct pppoetag pt; - int off = 0, err, errortag; + int off, err, errortag; struct eth_hdr *ethhdr; pb = pppSingleBuf(pb); @@ -410,7 +410,7 @@ pppoe_dispatch_disc_pkt(struct netif *netif, struct pbuf *pb) goto done; } ethhdr = (struct eth_hdr *)pb->payload; - off += sizeof(*ethhdr); + off = sizeof(*ethhdr); ac_cookie = NULL; ac_cookie_len = 0; @@ -419,7 +419,7 @@ pppoe_dispatch_disc_pkt(struct netif *netif, struct pbuf *pb) hunique_len = 0; #endif session = 0; - if (pb->len - off <= PPPOE_HEADERLEN) { + if (pb->len - off < PPPOE_HEADERLEN) { printf("pppoe: packet too short: %d\n", pb->len); goto done; }