@@ -156,15 +156,14 @@ static int send_test_packet(int ifindex)
156
156
return -1 ;
157
157
}
158
158
159
- static void assert_test_result (struct test_xdp_meta * skel )
159
+ static void assert_test_result (const struct bpf_map * result_map )
160
160
{
161
161
int err ;
162
162
__u32 map_key = 0 ;
163
163
__u8 map_value [TEST_PAYLOAD_LEN ];
164
164
165
- err = bpf_map__lookup_elem (skel -> maps .test_result , & map_key ,
166
- sizeof (map_key ), & map_value ,
167
- TEST_PAYLOAD_LEN , BPF_ANY );
165
+ err = bpf_map__lookup_elem (result_map , & map_key , sizeof (map_key ),
166
+ & map_value , TEST_PAYLOAD_LEN , BPF_ANY );
168
167
if (!ASSERT_OK (err , "lookup test_result" ))
169
168
return ;
170
169
@@ -248,7 +247,7 @@ void test_xdp_context_veth(void)
248
247
if (!ASSERT_OK (ret , "send_test_packet" ))
249
248
goto close ;
250
249
251
- assert_test_result (skel );
250
+ assert_test_result (skel -> maps . test_result );
252
251
253
252
close :
254
253
close_netns (nstoken );
@@ -313,7 +312,7 @@ void test_xdp_context_tuntap(void)
313
312
if (!ASSERT_EQ (ret , sizeof (packet ), "write packet" ))
314
313
goto close ;
315
314
316
- assert_test_result (skel );
315
+ assert_test_result (skel -> maps . test_result );
317
316
318
317
close :
319
318
if (tap_fd >= 0 )
0 commit comments