Commit 32748c69 authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Chris Friedt
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>
(cherry picked from commit 19392a6d)
parent 65104bc3
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
@@ -272,6 +272,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(&hdr->src)) {
			NET_DBG("DROP: src addr is %s", "mine");
			goto drop;
		}
	}

	if (net_ipv4_is_addr_mcast(&hdr->src)) {