diff --git a/net/devif/ipv4_input.c b/net/devif/ipv4_input.c index ae1a04cdc6b..1afec12ad50 100644 --- a/net/devif/ipv4_input.c +++ b/net/devif/ipv4_input.c @@ -184,6 +184,12 @@ int ipv4_input(FAR struct net_driver_s *dev) dev->d_len -= llhdrlen; + /* Make sure that all packet processing logic knows that there is an IPv4 + * packet in the device buffer. + */ + + IFF_SET_IPv4(dev->d_flags); + /* Check the size of the packet. If the size reported to us in d_len is * smaller the size reported in the IP header, we assume that the packet * has been corrupted in transit. If the size of d_len is larger than the @@ -354,12 +360,6 @@ int ipv4_input(FAR struct net_driver_s *dev) goto drop; } - /* 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 (ipv4->proto)