From: lottaviano Date: Tue, 24 May 2011 13:41:08 +0000 (+0000) Subject: Fix lwIP ethernet interface port. X-Git-Tag: 2.7.0~47 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=eefaad50a316d12474a2792088f9304903c059fa;p=bertos.git Fix lwIP ethernet interface port. Remove leftovers from old lwIP ethernetif ports and only use the new API. The same processing is done in upper layers when using tcpip_input as the input function of netif. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4919 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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;