@@ -179,8 +179,7 @@ ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2", NULL, NULL, ð_fake_data2, NULL,
179
179
CONFIG_ETH_INIT_PRIORITY , & eth_fake_api_funcs ,
180
180
NET_ETH_MTU );
181
181
182
- static void setup_packet_socket (int * sock , struct net_if * iface , int type ,
183
- int proto )
182
+ static void setup_packet_socket (int * sock , int type , int proto )
184
183
{
185
184
struct timeval optval = {
186
185
.tv_usec = 100000 ,
@@ -212,7 +211,7 @@ static void bind_packet_socket(int sock, struct net_if *iface)
212
211
static void prepare_packet_socket (int * sock , struct net_if * iface , int type ,
213
212
int proto )
214
213
{
215
- setup_packet_socket (sock , iface , type , proto );
214
+ setup_packet_socket (sock , type , proto );
216
215
bind_packet_socket (* sock , iface );
217
216
}
218
217
@@ -657,7 +656,7 @@ static void test_sendto_common(int sock_type, int proto, bool do_bind,
657
656
uint16_t pkt_len ;
658
657
int ret ;
659
658
660
- setup_packet_socket (& packet_sock_1 , ud . second , sock_type , htons (proto ));
659
+ setup_packet_socket (& packet_sock_1 , sock_type , htons (proto ));
661
660
if (do_bind ) {
662
661
bind_packet_socket (packet_sock_1 , ud .second );
663
662
}
@@ -717,7 +716,7 @@ static void test_sendmsg_common(int sock_type, int proto)
717
716
uint16_t pkt_len ;
718
717
int ret ;
719
718
720
- setup_packet_socket (& packet_sock_1 , ud . second , sock_type , htons (proto ));
719
+ setup_packet_socket (& packet_sock_1 , sock_type , htons (proto ));
721
720
prepare_udp_socket (& udp_sock_1 , & ip_src , DST_PORT );
722
721
prepare_test_packet (sock_type , ETH_P_IP , lladdr2 , lladdr1 , & pkt_len );
723
722
prepare_test_dst_lladdr (& ll_dst , ETH_P_IP , lladdr1 , ud .second );
@@ -810,11 +809,11 @@ static void test_recv_common(int sock_type, int proto, bool success)
810
809
int ret ;
811
810
812
811
/* Transmitting sock */
813
- setup_packet_socket (& packet_sock_1 , ud . second , SOCK_RAW , 0 );
812
+ setup_packet_socket (& packet_sock_1 , SOCK_RAW , 0 );
814
813
prepare_test_packet (SOCK_RAW , ETH_P_IP , lladdr2 , lladdr1 , & pkt_len );
815
814
prepare_test_dst_lladdr (& ll_dst , ETH_P_IP , lladdr1 , ud .second );
816
815
/* Receiving sock */
817
- setup_packet_socket (& packet_sock_2 , ud . first , sock_type , htons (proto ));
816
+ setup_packet_socket (& packet_sock_2 , sock_type , htons (proto ));
818
817
bind_packet_socket (packet_sock_2 , ud .first );
819
818
820
819
ret = zsock_sendto (packet_sock_1 , tx_buf , pkt_len , 0 ,
@@ -877,11 +876,11 @@ static void test_recvfrom_common(int sock_type, int proto)
877
876
int ret ;
878
877
879
878
/* Transmitting sock */
880
- setup_packet_socket (& packet_sock_1 , ud . second , SOCK_RAW , 0 );
879
+ setup_packet_socket (& packet_sock_1 , SOCK_RAW , 0 );
881
880
prepare_test_packet (SOCK_RAW , ETH_P_IP , lladdr2 , lladdr1 , & pkt_len );
882
881
prepare_test_dst_lladdr (& ll_dst , ETH_P_IP , lladdr1 , ud .second );
883
882
/* Receiving sock */
884
- setup_packet_socket (& packet_sock_2 , ud . first , sock_type , htons (proto ));
883
+ setup_packet_socket (& packet_sock_2 , sock_type , htons (proto ));
885
884
bind_packet_socket (packet_sock_2 , ud .first );
886
885
887
886
ret = zsock_sendto (packet_sock_1 , tx_buf , pkt_len , 0 ,
@@ -941,13 +940,13 @@ ZTEST(socket_packet, test_raw_dgram_udp_socks_recv)
941
940
int ret ;
942
941
943
942
/* Transmitting sock */
944
- setup_packet_socket (& packet_sock_1 , ud . second , SOCK_RAW , 0 );
943
+ setup_packet_socket (& packet_sock_1 , SOCK_RAW , 0 );
945
944
prepare_test_packet (SOCK_RAW , ETH_P_IP , lladdr2 , lladdr1 , & pkt_len );
946
945
prepare_test_dst_lladdr (& ll_dst , ETH_P_IP , lladdr1 , ud .second );
947
946
/* Receiving sockets */
948
- setup_packet_socket (& packet_sock_2 , ud . first , SOCK_RAW , htons (ETH_P_ALL ));
947
+ setup_packet_socket (& packet_sock_2 , SOCK_RAW , htons (ETH_P_ALL ));
949
948
bind_packet_socket (packet_sock_2 , ud .first );
950
- setup_packet_socket (& packet_sock_3 , ud . first , SOCK_DGRAM , htons (ETH_P_ALL ));
949
+ setup_packet_socket (& packet_sock_3 , SOCK_DGRAM , htons (ETH_P_ALL ));
951
950
bind_packet_socket (packet_sock_3 , ud .first );
952
951
prepare_udp_socket (& udp_sock_1 , & ip_src , DST_PORT );
953
952
0 commit comments