diff --git a/CHANGELOG b/CHANGELOG index 867d5d9a..dafbdce6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -312,6 +312,12 @@ HISTORY ++ Bug fixes: + 2007-08-28 Frédéric Bernon + * tcpip.c: Fix TCPIP_MSG_INPKT processing: now, tcpip_input can be used for any + kind of packets. These packets are considered like Ethernet packets (payload + pointing to ethhdr) if the netif got the NETIF_FLAG_ETHARP flag. Else, packets + are considered like IP packets (payload pointing to iphdr). + 2007-08-27 Frédéric Bernon * api.h, api_lib.c, api_msg.c: First fix for "bug #20900 : Potential crash error problem with netconn_peer & netconn_addr". Introduce NETCONN_LISTEN netconn_state diff --git a/src/api/tcpip.c b/src/api/tcpip.c index 64644bff..3d05921b 100644 --- a/src/api/tcpip.c +++ b/src/api/tcpip.c @@ -313,13 +313,17 @@ tcpip_thread(void *arg) msg->msg.apimsg->function(&(msg->msg.apimsg->msg)); break; -#if LWIP_ARP case TCPIP_MSG_INPKT: LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: PACKET %p\n", (void *)msg)); - ethernet_input(msg->msg.inp.p, msg->msg.inp.netif); +#if LWIP_ARP + if (msg->msg.inp.netif->flags & NETIF_FLAG_ETHARP) { + ethernet_input(msg->msg.inp.p, msg->msg.inp.netif); + } else +#endif /* LWIP_ARP */ + { ip_input(msg->msg.inp.p, msg->msg.inp.netif); + } memp_free(MEMP_TCPIP_MSG_INPKT, msg); break; -#endif /* LWIP_ARP */ #if LWIP_NETIF_API case TCPIP_MSG_NETIFAPI: @@ -354,7 +358,8 @@ tcpip_thread(void *arg) /** * Pass a received packet to tcpip_thread for input processing * - * @param p the received packet, p->payload pointing to the Ethernet header + * @param p the received packet, p->payload pointing to the Ethernet header or + * to an IP header (if netif doesn't got NETIF_FLAG_ETHARP flag) * @param netif the network interface on which the packet was received */ err_t