X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fnet%2Flwip%2Fsrc%2Fnetif%2Fethernetif.c;h=336614de3dd00a4f963d349adbd6125d2cec034e;hb=HEAD;hp=9618061c3fcc5ceda903a49808ce2406a583a96b;hpb=b6ffb3c9076a72c087b57468ab3e994bd1eb2f69;p=bertos.git diff --git a/bertos/net/lwip/src/netif/ethernetif.c b/bertos/net/lwip/src/netif/ethernetif.c index 9618061c..336614de 100644 --- a/bertos/net/lwip/src/netif/ethernetif.c +++ b/bertos/net/lwip/src/netif/ethernetif.c @@ -248,22 +248,22 @@ static void ethernetif_input(struct netif *netif) /* move received packet into a new pbuf */ p = low_level_input(netif); /* no packet could be read, silently ignore this */ - if (p == NULL) return; - + if (p == NULL) + return; + /* points to packet payload, which starts with an Ethernet header */ ethhdr = p->payload; switch (htons(ethhdr->type)) { - case ETHTYPE_ARP: - etharp_arp_input(netif, ethernetif->ethaddr, p); - break; - + /* IP or ARP packet? */ case ETHTYPE_IP: -#if DHCP_DOES_ARP_CHECK - etharp_ip_input(netif, p); -#endif - pbuf_header(p, (int16_t) - sizeof(struct eth_hdr)); - + case ETHTYPE_ARP: +#if PPPOE_SUPPORT + /* PPPoE packet? */ + case ETHTYPE_PPPOEDISC: + case ETHTYPE_PPPOE: +#endif /* PPPOE_SUPPORT */ + /* full packet send to tcpip_thread to process */ if (netif->input(p, netif) != ERR_OK) { LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n")); @@ -271,6 +271,7 @@ static void ethernetif_input(struct netif *netif) p = NULL; } break; + default: pbuf_free(p); p = NULL; @@ -278,6 +279,7 @@ static void ethernetif_input(struct netif *netif) } } + static NORETURN void ethernetif_loop(void *arg) { struct netif *netif = (struct netif *)arg;