Skip to content
Permalink
Browse files

net: ipv4: Drop pkt if src address is unspecified

If we receive IPv4 packet where source address is unspecified
(all zeros), then we need to drop it.

Fixes #17427

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed Jul 9, 2019
1 parent 3717c6b commit 868cd477d56dd869fe497151dbb10741f7d9a39b
Showing with 7 additions and 2 deletions.
  1. +7 −2 subsys/net/ip/ipv4.c
@@ -150,12 +150,17 @@ enum net_verdict net_ipv4_input(struct net_pkt *pkt)
}

if (net_ipv4_is_addr_mcast(&hdr->src)) {
NET_DBG("DROP: src addr is mcast");
NET_DBG("DROP: src addr is %s", "mcast");
goto drop;
}

if (net_ipv4_is_addr_bcast(net_pkt_iface(pkt), &hdr->src)) {
NET_DBG("DROP: src addr is bcast");
NET_DBG("DROP: src addr is %s", "bcast");
goto drop;
}

if (net_ipv4_is_addr_unspecified(&hdr->src)) {
NET_DBG("DROP: src addr is %s", "unspecified");
goto drop;
}

0 comments on commit 868cd47

Please sign in to comment.
You can’t perform that action at this time.