Skip to content

Commit 6654f78

Browse files
rluboskartben
authored andcommitted
tests: net: socket: af_packet: Remove unused param
iface parameter in setup_packet_socket() function was not used, remove it to avoid confusion. Signed-off-by: Robert Lubos <[email protected]>
1 parent cd50608 commit 6654f78

File tree

1 file changed

+11
-12
lines changed
  • tests/net/socket/af_packet/src

1 file changed

+11
-12
lines changed

tests/net/socket/af_packet/src/main.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2", NULL, NULL, &eth_fake_data2, NULL,
179179
CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
180180
NET_ETH_MTU);
181181

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)
184183
{
185184
struct timeval optval = {
186185
.tv_usec = 100000,
@@ -212,7 +211,7 @@ static void bind_packet_socket(int sock, struct net_if *iface)
212211
static void prepare_packet_socket(int *sock, struct net_if *iface, int type,
213212
int proto)
214213
{
215-
setup_packet_socket(sock, iface, type, proto);
214+
setup_packet_socket(sock, type, proto);
216215
bind_packet_socket(*sock, iface);
217216
}
218217

@@ -657,7 +656,7 @@ static void test_sendto_common(int sock_type, int proto, bool do_bind,
657656
uint16_t pkt_len;
658657
int ret;
659658

660-
setup_packet_socket(&packet_sock_1, ud.second, sock_type, htons(proto));
659+
setup_packet_socket(&packet_sock_1, sock_type, htons(proto));
661660
if (do_bind) {
662661
bind_packet_socket(packet_sock_1, ud.second);
663662
}
@@ -717,7 +716,7 @@ static void test_sendmsg_common(int sock_type, int proto)
717716
uint16_t pkt_len;
718717
int ret;
719718

720-
setup_packet_socket(&packet_sock_1, ud.second, sock_type, htons(proto));
719+
setup_packet_socket(&packet_sock_1, sock_type, htons(proto));
721720
prepare_udp_socket(&udp_sock_1, &ip_src, DST_PORT);
722721
prepare_test_packet(sock_type, ETH_P_IP, lladdr2, lladdr1, &pkt_len);
723722
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)
810809
int ret;
811810

812811
/* Transmitting sock */
813-
setup_packet_socket(&packet_sock_1, ud.second, SOCK_RAW, 0);
812+
setup_packet_socket(&packet_sock_1, SOCK_RAW, 0);
814813
prepare_test_packet(SOCK_RAW, ETH_P_IP, lladdr2, lladdr1, &pkt_len);
815814
prepare_test_dst_lladdr(&ll_dst, ETH_P_IP, lladdr1, ud.second);
816815
/* 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));
818817
bind_packet_socket(packet_sock_2, ud.first);
819818

820819
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)
877876
int ret;
878877

879878
/* Transmitting sock */
880-
setup_packet_socket(&packet_sock_1, ud.second, SOCK_RAW, 0);
879+
setup_packet_socket(&packet_sock_1, SOCK_RAW, 0);
881880
prepare_test_packet(SOCK_RAW, ETH_P_IP, lladdr2, lladdr1, &pkt_len);
882881
prepare_test_dst_lladdr(&ll_dst, ETH_P_IP, lladdr1, ud.second);
883882
/* 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));
885884
bind_packet_socket(packet_sock_2, ud.first);
886885

887886
ret = zsock_sendto(packet_sock_1, tx_buf, pkt_len, 0,
@@ -941,13 +940,13 @@ ZTEST(socket_packet, test_raw_dgram_udp_socks_recv)
941940
int ret;
942941

943942
/* Transmitting sock */
944-
setup_packet_socket(&packet_sock_1, ud.second, SOCK_RAW, 0);
943+
setup_packet_socket(&packet_sock_1, SOCK_RAW, 0);
945944
prepare_test_packet(SOCK_RAW, ETH_P_IP, lladdr2, lladdr1, &pkt_len);
946945
prepare_test_dst_lladdr(&ll_dst, ETH_P_IP, lladdr1, ud.second);
947946
/* 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));
949948
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));
951950
bind_packet_socket(packet_sock_3, ud.first);
952951
prepare_udp_socket(&udp_sock_1, &ip_src, DST_PORT);
953952

0 commit comments

Comments
 (0)