mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-06 22:44:38 +08:00
Fixed checking input packet length (20 bytes is a valid packet and is used e.g. with MS RAS server)
This commit is contained in:
parent
96e8f16c05
commit
5da0620c6b
@ -398,7 +398,7 @@ pppoe_dispatch_disc_pkt(struct netif *netif, struct pbuf *pb)
|
|||||||
#endif
|
#endif
|
||||||
struct pppoehdr *ph;
|
struct pppoehdr *ph;
|
||||||
struct pppoetag pt;
|
struct pppoetag pt;
|
||||||
int off = 0, err, errortag;
|
int off, err, errortag;
|
||||||
struct eth_hdr *ethhdr;
|
struct eth_hdr *ethhdr;
|
||||||
|
|
||||||
pb = pppSingleBuf(pb);
|
pb = pppSingleBuf(pb);
|
||||||
@ -410,7 +410,7 @@ pppoe_dispatch_disc_pkt(struct netif *netif, struct pbuf *pb)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
ethhdr = (struct eth_hdr *)pb->payload;
|
ethhdr = (struct eth_hdr *)pb->payload;
|
||||||
off += sizeof(*ethhdr);
|
off = sizeof(*ethhdr);
|
||||||
|
|
||||||
ac_cookie = NULL;
|
ac_cookie = NULL;
|
||||||
ac_cookie_len = 0;
|
ac_cookie_len = 0;
|
||||||
@ -419,7 +419,7 @@ pppoe_dispatch_disc_pkt(struct netif *netif, struct pbuf *pb)
|
|||||||
hunique_len = 0;
|
hunique_len = 0;
|
||||||
#endif
|
#endif
|
||||||
session = 0;
|
session = 0;
|
||||||
if (pb->len - off <= PPPOE_HEADERLEN) {
|
if (pb->len - off < PPPOE_HEADERLEN) {
|
||||||
printf("pppoe: packet too short: %d\n", pb->len);
|
printf("pppoe: packet too short: %d\n", pb->len);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user