@@ -343,6 +343,31 @@ static void test_sock_ip_recv__non_blocking(void)
343343 expect (_check_net ());
344344}
345345
346+ static void test_sock_ip_recv__aux (void )
347+ {
348+ static const ipv6_addr_t src_addr = { .u8 = _TEST_ADDR_REMOTE };
349+ static const ipv6_addr_t dst_addr = { .u8 = _TEST_ADDR_LOCAL };
350+ static const sock_ip_ep_t local = { .family = AF_INET6 };
351+ sock_ip_ep_t result ;
352+ sock_ip_aux_rx_t aux ;
353+
354+ expect (0 == sock_ip_create (& _sock , & local , NULL , _TEST_PROTO ,
355+ SOCK_FLAGS_REUSE_EP ));
356+ expect (_inject_packet (& src_addr , & dst_addr , _TEST_PROTO , "ABCD" ,
357+ sizeof ("ABCD" ), _TEST_NETIF ));
358+ expect (sizeof ("ABCD" ) == sock_ip_recv_aux (& _sock , _test_buffer ,
359+ sizeof (_test_buffer ), 0 , & result ,
360+ & aux ));
361+ expect (AF_INET6 == result .family );
362+ expect (memcmp (& result .addr , & src_addr , sizeof (result .addr )) == 0 );
363+ expect (_TEST_NETIF == result .netif );
364+ #ifdef MODULE_SOCK_AUX_LOCAL
365+ expect (aux .flags & SOCK_AUX_HAS_LOCAL );
366+ expect (memcmp (& aux .local .addr , & dst_addr , sizeof (dst_addr )) == 0 );
367+ #endif
368+ expect (_check_net ());
369+ }
370+
346371static void test_sock_ip_recv_buf__success (void )
347372{
348373 static const ipv6_addr_t src_addr = { .u8 = _TEST_ADDR_REMOTE };
@@ -639,6 +664,7 @@ int main(void)
639664 CALL (test_sock_ip_recv__unsocketed_with_remote ());
640665 CALL (test_sock_ip_recv__with_timeout ());
641666 CALL (test_sock_ip_recv__non_blocking ());
667+ CALL (test_sock_ip_recv__aux ());
642668 CALL (test_sock_ip_recv_buf__success ());
643669 _prepare_send_checks ();
644670 CALL (test_sock_ip_send__EAFNOSUPPORT ());
0 commit comments