Commit 19392a6d authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Carles Cufi
Browse files

net: ipv4: Drop packet if source address is my address

If we receive a packet where the source address is our own
address, then we should drop it.

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@nordicsemi.no>
parent 6d41e683
Loading
Loading
Loading
Loading
+5 −0
Changes for subsys/net/ip/ipv4.c: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -299,6 +299,11 @@ enum net_verdict net_ipv4_input(struct net_pkt *pkt, bool is_loopback)
			NET_DBG("DROP: localhost packet");
			goto drop;
		}

		if (net_ipv4_is_my_addr((struct in_addr *)hdr->src)) {
			NET_DBG("DROP: src addr is %s", "mine");
			goto drop;
		}
	}

	if (net_ipv4_is_addr_mcast((struct in_addr *)hdr->src)) {