Commit 0c709101 authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Josh Lilly
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>
(cherry picked from commit 8d3d48e0)
parent 7215f361
Loading
Loading
Loading
Loading
+5 −0
Changes for subsys/net/ip/ipv6.c: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -502,6 +502,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. */