net/ip: fix nxstyle warning

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2021-01-30 08:58:47 +08:00 committed by Brennan Ashton
parent ab148bc69f
commit 38e2c4ba53
2 changed files with 11 additions and 8 deletions

View File

@ -207,11 +207,11 @@ int ipv4_input(FAR struct net_driver_s *dev)
if ((ipv4->ipoffset[0] & 0x3f) != 0 || ipv4->ipoffset[1] != 0) if ((ipv4->ipoffset[0] & 0x3f) != 0 || ipv4->ipoffset[1] != 0)
{ {
#ifdef CONFIG_NET_STATISTICS #ifdef CONFIG_NET_STATISTICS
g_netstats.ipv4.drop++; g_netstats.ipv4.drop++;
g_netstats.ipv4.fragerr++; g_netstats.ipv4.fragerr++;
#endif #endif
nwarn("WARNING: IP fragment dropped\n"); nwarn("WARNING: IP fragment dropped\n");
goto drop; goto drop;
} }
/* Get the destination IP address in a friendlier form */ /* Get the destination IP address in a friendlier form */
@ -314,6 +314,7 @@ int ipv4_input(FAR struct net_driver_s *dev)
} }
} }
#ifdef CONFIG_NET_ICMP #ifdef CONFIG_NET_ICMP
/* In other cases, the device must be assigned a non-zero IP address. */ /* In other cases, the device must be assigned a non-zero IP address. */
else if (net_ipv4addr_cmp(dev->d_ipaddr, INADDR_ANY)) else if (net_ipv4addr_cmp(dev->d_ipaddr, INADDR_ANY))

View File

@ -391,8 +391,8 @@ int ipv6_input(FAR struct net_driver_s *dev)
{ {
#ifdef CONFIG_NET_IPFORWARD_BROADCAST #ifdef CONFIG_NET_IPFORWARD_BROADCAST
/* Packets sent to ffx0 are reserved, ffx1 are interface-local, and ffx2 /* Packets sent to ffx0 are reserved, ffx1 are interface-local, and
* are interface-local, and therefore, should not be forwarded * ffx2 are interface-local, and therefore, should not be forwarded
*/ */
if ((ipv6->destipaddr[0] & HTONS(0xff0f) != HTONS(0xff00)) && if ((ipv6->destipaddr[0] & HTONS(0xff0f) != HTONS(0xff00)) &&
@ -435,9 +435,11 @@ int ipv6_input(FAR struct net_driver_s *dev)
#endif #endif
if (nxthdr != IP_PROTO_UDP) if (nxthdr != IP_PROTO_UDP)
{ {
/* Not destined for us and not forwardable... drop the packet. */ /* Not destined for us and not forwardable...
* drop the packet.
*/
nwarn("WARNING: Not destined for us; not forwardable... Dropping!\n"); nwarn("WARNING: Not destined for us... Dropping!\n");
goto drop; goto drop;
} }
} }