Commit 8d3d48e0 authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Fabio Baltieri
Browse files

net: ipv6: Check that received src address is not mine



Drop received packet if the source address is the same as
the device address.

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@nordicsemi.no>
parent 48601fde
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -520,6 +520,11 @@ enum net_verdict net_ipv6_input(struct net_pkt *pkt, bool is_loopback)
			NET_DBG("DROP: invalid scope multicast packet");
			goto drop;
		}

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

	/* Reconstruct TC field. */