@@ -380,12 +380,6 @@ static struct net_pkt *prepare_fin_ack_packet(sa_family_t af, uint16_t src_port,
380
380
NULL , 0U );
381
381
}
382
382
383
- static struct net_pkt * prepare_fin_packet (sa_family_t af , uint16_t src_port ,
384
- uint16_t dst_port )
385
- {
386
- return tester_prepare_tcp_pkt (af , src_port , dst_port , FIN , NULL , 0U );
387
- }
388
-
389
383
static struct net_pkt * prepare_rst_packet (sa_family_t af , uint16_t src_port ,
390
384
uint16_t dst_port )
391
385
{
@@ -1166,7 +1160,7 @@ static void handle_client_fin_wait_2_test(sa_family_t af, struct tcphdr *th)
1166
1160
break ;
1167
1161
case T_FIN_2 :
1168
1162
t_state = T_FIN_ACK ;
1169
- reply = prepare_fin_packet (af , htons (MY_PORT ), th -> th_sport );
1163
+ reply = prepare_fin_ack_packet (af , htons (MY_PORT ), th -> th_sport );
1170
1164
break ;
1171
1165
case T_FIN_ACK :
1172
1166
test_verify_flags (th , ACK );
@@ -1459,7 +1453,7 @@ static void handle_data_fin1_test(sa_family_t af, struct tcphdr *th)
1459
1453
break ;
1460
1454
case T_FIN_2 :
1461
1455
t_state = T_FIN_ACK ;
1462
- reply = prepare_fin_packet (af , htons (MY_PORT ), th -> th_sport );
1456
+ reply = prepare_fin_ack_packet (af , htons (MY_PORT ), th -> th_sport );
1463
1457
break ;
1464
1458
case T_FIN_ACK :
1465
1459
test_verify_flags (th , ACK );
@@ -1813,12 +1807,12 @@ static void handle_client_closing_failure_test(sa_family_t af, struct tcphdr *th
1813
1807
case T_FIN :
1814
1808
test_verify_flags (th , FIN | ACK );
1815
1809
t_state = T_FIN_1 ;
1816
- reply = prepare_fin_packet (af , htons (MY_PORT ), th -> th_sport );
1810
+ reply = prepare_fin_ack_packet (af , htons (MY_PORT ), th -> th_sport );
1817
1811
break ;
1818
1812
case T_FIN_1 :
1819
1813
test_verify_flags (th , FIN | ACK );
1820
1814
t_state = T_CLOSING ;
1821
- reply = prepare_fin_packet (af , htons (MY_PORT ), th -> th_sport );
1815
+ reply = prepare_fin_ack_packet (af , htons (MY_PORT ), th -> th_sport );
1822
1816
break ;
1823
1817
case T_CLOSING :
1824
1818
test_verify_flags (th , FIN | ACK );
@@ -2418,7 +2412,6 @@ ZTEST(net_tcp, test_client_rst_on_unexpected_ack_on_syn)
2418
2412
#define TEST_FIN_DATA "test_data"
2419
2413
2420
2414
static enum fin_data_variant {
2421
- FIN_DATA_FIN ,
2422
2415
FIN_DATA_FIN_ACK ,
2423
2416
FIN_DATA_FIN_ACK_PSH ,
2424
2417
} test_fin_data_variant ;
@@ -2458,10 +2451,6 @@ static void handle_client_fin_ack_with_data_test(sa_family_t af, struct tcphdr *
2458
2451
return ;
2459
2452
case T_DATA :
2460
2453
switch (test_fin_data_variant ) {
2461
- case FIN_DATA_FIN :
2462
- flags = FIN ;
2463
- t_state = T_FIN ;
2464
- break ;
2465
2454
case FIN_DATA_FIN_ACK :
2466
2455
flags = FIN | ACK ;
2467
2456
t_state = T_FIN_ACK ;
@@ -2500,7 +2489,7 @@ static void handle_client_fin_ack_with_data_test(sa_family_t af, struct tcphdr *
2500
2489
break ;
2501
2490
2502
2491
case T_CLOSING :
2503
- test_verify_flags (th , FIN );
2492
+ test_verify_flags (th , FIN | ACK );
2504
2493
zassert_equal (get_rel_seq (th ), 1 , "Unexpected SEQ number in T_CLOSING, got %d" ,
2505
2494
get_rel_seq (th ));
2506
2495
@@ -2568,7 +2557,7 @@ ZTEST(net_tcp, test_client_fin_ack_with_data)
2568
2557
2569
2558
k_work_init_delayable (& test_fin_data_work , test_fin_data_handler );
2570
2559
2571
- for (enum fin_data_variant variant = FIN_DATA_FIN ;
2560
+ for (enum fin_data_variant variant = FIN_DATA_FIN_ACK ;
2572
2561
variant <= FIN_DATA_FIN_ACK_PSH ; variant ++ ) {
2573
2562
test_fin_data_variant = variant ;
2574
2563
t_state = T_SYN ;
0 commit comments