Commit 01ad1125 authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Chris Friedt
Browse files

tests: net: ipv6: Adjust the source address of test pkt



We would drop the received packet if the source address is our
address so tweak the test and make source address different.

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 155e2149)
parent 652b7f6f
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -1171,7 +1171,7 @@ static void test_src_localaddr_recv(void)
	struct in6_addr localaddr = { { { 0, 0, 0, 0, 0, 0, 0, 0,
					  0, 0, 0, 0, 0, 0, 0, 0x1 } } };
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0, 0, 0x10 } } };
	enum net_verdict verdict;

	verdict = recv_msg(&localaddr, &addr);
@@ -1184,7 +1184,7 @@ static void test_dst_localaddr_recv(void)
	struct in6_addr localaddr = { { { 0, 0, 0, 0, 0, 0, 0, 0,
					  0, 0, 0, 0, 0, 0, 0, 0x1 } } };
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0, 0, 0x10 } } };
	enum net_verdict verdict;

	verdict = recv_msg(&addr, &localaddr);
@@ -1197,7 +1197,7 @@ static void test_dst_iface_scope_mcast_recv(void)
	struct in6_addr mcast_iface = { { { 0xff, 0x01, 0, 0, 0, 0, 0, 0,
					    0, 0, 0, 0, 0, 0, 0, 0 } } };
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0, 0, 0x10 } } };
	enum net_verdict verdict;

	verdict = recv_msg(&addr, &mcast_iface);
@@ -1210,7 +1210,7 @@ static void test_dst_zero_scope_mcast_recv(void)
	struct in6_addr mcast_zero = { { { 0xff, 0x00, 0, 0, 0, 0, 0, 0,
					   0, 0, 0, 0, 0, 0, 0, 0 } } };
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0, 0, 0x10 } } };
	enum net_verdict verdict;

	verdict = recv_msg(&addr, &mcast_zero);
@@ -1223,7 +1223,7 @@ static void test_dst_site_scope_mcast_recv_drop(void)
	struct in6_addr mcast_site = { { { 0xff, 0x05, 0, 0, 0, 0, 0, 0,
					   0, 0, 0, 0, 0, 0, 0, 0 } } };
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0, 0, 0x10 } } };
	enum net_verdict verdict;

	verdict = recv_msg(&addr, &mcast_site);
@@ -1302,7 +1302,7 @@ static void test_dst_site_scope_mcast_recv_ok(void)
	struct in6_addr mcast_all_dhcp = { { { 0xff, 0x05, 0, 0, 0, 0, 0, 0,
					    0, 0, 0, 0x01, 0, 0, 0, 0x03 } } };
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0, 0, 0x10 } } };
	enum net_verdict verdict;
	struct net_context *ctx;

@@ -1329,7 +1329,7 @@ static void test_dst_org_scope_mcast_recv(void)
	struct in6_addr mcast_org = { { { 0xff, 0x08, 0, 0, 0, 0, 0, 0,
					  0, 0, 0, 0, 0, 0, 0, 0 } } };
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0, 0, 0x10 } } };
	enum net_verdict verdict;

	verdict = recv_msg(&addr, &mcast_org);
@@ -1342,7 +1342,7 @@ static void test_dst_iface_scope_mcast_send(void)
	struct in6_addr mcast_iface = { { { 0xff, 0x01, 0, 0, 0, 0, 0, 0,
					    0, 0, 0, 0, 0, 0, 0, 0 } } };
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0, 0, 0x10 } } };
	struct net_if_mcast_addr *maddr;
	struct net_context *ctx;
	int ret;
@@ -1382,7 +1382,7 @@ static void test_dst_unknown_group_mcast_recv(void)
	};
	struct in6_addr in6_addr_any = IN6ADDR_ANY_INIT;
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0x10 } } };
	struct net_context *ctx;
	enum net_verdict verdict;

@@ -1412,7 +1412,7 @@ static void test_dst_unjoined_group_mcast_recv(void)
	};
	struct in6_addr in6_addr_any = IN6ADDR_ANY_INIT;
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0x10 } } };
	struct net_if_mcast_addr *maddr;
	struct net_context *ctx;
	enum net_verdict verdict;
@@ -1454,7 +1454,7 @@ static void test_dst_is_other_iface_mcast_recv(void)
					     0x08 } } };
	struct in6_addr in6_addr_any = IN6ADDR_ANY_INIT;
	struct in6_addr addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0,
				     0, 0, 0, 0, 0, 0x1 } } };
				     0, 0, 0, 0, 0, 0x10 } } };
	struct net_if_mcast_addr *maddr;
	struct net_context *ctx;
	enum net_verdict verdict;