[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Upgrading lwip 1.4.1 to 2.0.0 pbuf (or other) issue?
From: |
Sergio R. Caprile |
Subject: |
Re: [lwip-users] Upgrading lwip 1.4.1 to 2.0.0 pbuf (or other) issue? |
Date: |
Mon, 5 Dec 2016 17:25:06 -0300 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
I can tell you two things:
You can't really take a low-level driver for version x and dump it into
version y without hassle. It should work, but you also should read the
docs because there can always be, and there have been, changes.
There is some slight difference with the way 2.0.0 handles incoming
frames in comparison with how 1.4.1 did. A 1.4.1 driver will only get
IPv4 and ARP; a 2.0.0 driver will get everything. That would explain
that "not for us" message you see.
If you diff ethernetif.c:
< switch (htons(ethhdr->type)) {
< /* IP or ARP packet? */
< case ETHTYPE_IP:
< 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"));
< pbuf_free(p);
< p = NULL;
< }
< break;
<
< default:
< pbuf_free(p);
< p = NULL;
< break;
---
> /* if no packet could be read, silently ignore this */
> if (p != NULL) {
> /* pass all packets to ethernet_input, which decides what packets
it supports */
> if (netif->input(p, netif) != ERR_OK) {
> LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
> pbuf_free(p);
> p = NULL;
> }
280c295
<
You need to check the code in the ethernetif department and modify your
layer-2 driver to work with 2.0.0. I can't help any further because I
still didn't do it with my driver.