@@ -2039,7 +2039,7 @@ START_TEST(test_icmp_input_dest_unreach_port_unreachable_closes_matching_tcp_soc
20392039 struct wolfIP s ;
20402040 struct tsocket * ts ;
20412041 struct wolfIP_icmp_dest_unreachable_packet icmp ;
2042- struct wolfIP_tcp_seg * orig ;
2042+ struct wolfIP_tcp_wire_prefix * orig ;
20432043 uint32_t frame_len ;
20442044
20452045 wolfIP_init (& s );
@@ -2065,15 +2065,14 @@ START_TEST(test_icmp_input_dest_unreach_port_unreachable_closes_matching_tcp_soc
20652065 icmp .type = ICMP_DEST_UNREACH ;
20662066 icmp .code = ICMP_PORT_UNREACH ;
20672067
2068- orig = (struct wolfIP_tcp_seg * )icmp .orig_packet ;
2068+ orig = (struct wolfIP_tcp_wire_prefix * )icmp .orig_packet ;
20692069 orig -> ip .ver_ihl = 0x45 ;
20702070 orig -> ip .proto = WI_IPPROTO_TCP ;
20712071 orig -> ip .src = ee32 (ts -> local_ip );
20722072 orig -> ip .dst = ee32 (ts -> remote_ip );
2073- orig -> ip .len = ee16 (IP_HEADER_LEN + TCP_HEADER_LEN );
2073+ orig -> ip .len = ee16 (IP_HEADER_LEN + 8U );
20742074 orig -> src_port = ee16 (ts -> src_port );
20752075 orig -> dst_port = ee16 (ts -> dst_port );
2076- orig -> hlen = TCP_HEADER_LEN << 2 ;
20772076
20782077 icmp .csum = ee16 (icmp_checksum ((struct wolfIP_icmp_packet * )& icmp ,
20792078 ICMP_DEST_UNREACH_SIZE ));
@@ -2090,7 +2089,7 @@ START_TEST(test_icmp_input_dest_unreach_frag_needed_reduces_tcp_peer_mss)
20902089 struct wolfIP s ;
20912090 struct tsocket * ts ;
20922091 struct wolfIP_icmp_dest_unreachable_packet icmp ;
2093- struct wolfIP_tcp_seg * orig ;
2092+ struct wolfIP_tcp_wire_prefix * orig ;
20942093 uint32_t frame_len ;
20952094 uint16_t next_hop_mtu ;
20962095
@@ -2116,19 +2115,18 @@ START_TEST(test_icmp_input_dest_unreach_frag_needed_reduces_tcp_peer_mss)
21162115 icmp .ip .proto = WI_IPPROTO_ICMP ;
21172116 icmp .ip .len = ee16 (IP_HEADER_LEN + ICMP_DEST_UNREACH_SIZE );
21182117 icmp .type = ICMP_DEST_UNREACH ;
2119- icmp .code = 4 ;
2118+ icmp .code = ICMP_FRAG_NEEDED ;
21202119 next_hop_mtu = ee16 (576U );
21212120 memcpy (& icmp .unused [2 ], & next_hop_mtu , sizeof (next_hop_mtu ));
21222121
2123- orig = (struct wolfIP_tcp_seg * )icmp .orig_packet ;
2122+ orig = (struct wolfIP_tcp_wire_prefix * )icmp .orig_packet ;
21242123 orig -> ip .ver_ihl = 0x45 ;
21252124 orig -> ip .proto = WI_IPPROTO_TCP ;
21262125 orig -> ip .src = ee32 (ts -> local_ip );
21272126 orig -> ip .dst = ee32 (ts -> remote_ip );
2128- orig -> ip .len = ee16 (IP_HEADER_LEN + TCP_HEADER_LEN );
2127+ orig -> ip .len = ee16 (IP_HEADER_LEN + 8U );
21292128 orig -> src_port = ee16 (ts -> src_port );
21302129 orig -> dst_port = ee16 (ts -> dst_port );
2131- orig -> hlen = TCP_HEADER_LEN << 2 ;
21322130
21332131 icmp .csum = ee16 (icmp_checksum ((struct wolfIP_icmp_packet * )& icmp ,
21342132 ICMP_DEST_UNREACH_SIZE ));
0 commit comments