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

@ -314,6 +314,7 @@ int ipv4_input(FAR struct net_driver_s *dev)
}
}
#ifdef CONFIG_NET_ICMP
/* In other cases, the device must be assigned a non-zero IP address. */
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
/* Packets sent to ffx0 are reserved, ffx1 are interface-local, and ffx2
* are interface-local, and therefore, should not be forwarded
/* Packets sent to ffx0 are reserved, ffx1 are interface-local, and
* ffx2 are interface-local, and therefore, should not be forwarded
*/
if ((ipv6->destipaddr[0] & HTONS(0xff0f) != HTONS(0xff00)) &&
@ -435,9 +435,11 @@ int ipv6_input(FAR struct net_driver_s *dev)
#endif
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;
}
}