File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -965,6 +965,10 @@ impl<'a> TcpSocket<'a> {
965
965
repr. ack_number = Some ( ack_number) ;
966
966
self . remote_last_ack = ack_number;
967
967
968
+ // Remember the header length before enabling the MSS option, since that option
969
+ // only affects SYN packets.
970
+ let header_len = repr. header_len ( ) ;
971
+
968
972
if repr. control == TcpControl :: Syn {
969
973
// First enable the option, without assigning any value, to get a correct
970
974
// result for (ip_repr:Unspecified).payload_len below.
@@ -980,7 +984,7 @@ impl<'a> TcpSocket<'a> {
980
984
let ip_repr = try!( ip_repr. lower ( & [ ] ) ) ;
981
985
982
986
if repr. control == TcpControl :: Syn {
983
- let mtu = mtu - repr . header_len ( ) - ip_repr. buffer_len ( ) ;
987
+ let mtu = mtu - header_len - ip_repr. buffer_len ( ) ;
984
988
repr. max_seg_size = Some ( mtu as u16 ) ;
985
989
}
986
990
You can’t perform that action at this time.
0 commit comments