Skip to content

Commit

Permalink
tests: net: ipv6: Adjust the source address of test pkt
Browse files Browse the repository at this point in the history
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: Jukka Rissanen <[email protected]>
(cherry picked from commit 155e214)
  • Loading branch information
jukkar authored and cfriedt committed Jan 9, 2024
1 parent 652b7f6 commit 01ad112
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/net/ipv6/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand All @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 01ad112

Please sign in to comment.