diff options
Diffstat (limited to 'nuttx/net/devif')
-rw-r--r-- | nuttx/net/devif/ipv4_input.c | 14 | ||||
-rw-r--r-- | nuttx/net/devif/ipv6_input.c | 10 |
2 files changed, 19 insertions, 5 deletions
diff --git a/nuttx/net/devif/ipv4_input.c b/nuttx/net/devif/ipv4_input.c index 394b220a7..fcdf1efd3 100644 --- a/nuttx/net/devif/ipv4_input.c +++ b/nuttx/net/devif/ipv4_input.c @@ -85,6 +85,8 @@ #include <debug.h> #include <string.h> +#include <net/if.h> + #include <nuttx/net/netconfig.h> #include <nuttx/net/netdev.h> #include <nuttx/net/netstats.h> @@ -220,7 +222,9 @@ static uint8_t devif_reassembly(void) { g_reassembly_bitmap[i] = 0xff; } - g_reassembly_bitmap[(offset + len) / (8 * 8)] |= ~g_bitmap_bits[((offset + len) / 8 ) & 7]; + + g_reassembly_bitmap[(offset + len) / (8 * 8)] |= + ~g_bitmap_bits[((offset + len) / 8 ) & 7]; } /* If this fragment has the More Fragments flag set to zero, we know that @@ -450,10 +454,14 @@ int ipv4_input(FAR struct net_driver_s *dev) goto drop; } - /* Everything looks good so far. Now process the incoming packet - * according to the protocol. + /* Make sure that all packet processing logic knows that there is an IPv4 + * packet in the device buffer. */ + IFF_SET_IPv4(dev->d_flags); + + /* Now process the incoming packet according to the protocol. */ + switch (pbuf->proto) { #ifdef CONFIG_NET_TCP diff --git a/nuttx/net/devif/ipv6_input.c b/nuttx/net/devif/ipv6_input.c index d50838902..a613f1975 100644 --- a/nuttx/net/devif/ipv6_input.c +++ b/nuttx/net/devif/ipv6_input.c @@ -85,6 +85,8 @@ #include <debug.h> #include <string.h> +#include <net/if.h> + #include <nuttx/net/netconfig.h> #include <nuttx/net/netdev.h> #include <nuttx/net/netstats.h> @@ -249,10 +251,14 @@ int ipv6_input(FAR struct net_driver_s *dev) } } - /* Everything looks good so far. Now process the incoming packet - * according to the protocol. + /* Make sure that all packet processing logic knows that there is an IPv6 + * packet in the device buffer. */ + IFF_SET_IPv6(dev->d_flags); + + /* Now process the incoming packet according to the protocol. */ + switch (ipv6->proto) { #ifdef CONFIG_NET_TCP |