Browse Source

Revert to prevous ordering of TCP options.

Although ordering is not specified in the spec, some implementations expect
some ordering (unforntunately I have found one that does, and blocks outbound
packets due to 'invalid tcp options').
Scott Mabin 5 years ago
parent
commit
e74ad03b8a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/wire/tcp.rs

+ 3 - 3
src/wire/tcp.rs

@@ -893,12 +893,12 @@ impl<'a> Repr<'a> {
         packet.set_ack(self.ack_number.is_some());
         {
             let mut options = packet.options_mut();
-            if let Some(value) = self.window_scale {
-                let tmp = options; options = TcpOption::WindowScale(value).emit(tmp);
-            }
             if let Some(value) = self.max_seg_size {
                 let tmp = options; options = TcpOption::MaxSegmentSize(value).emit(tmp);
             }
+            if let Some(value) = self.window_scale {
+                let tmp = options; options = TcpOption::WindowScale(value).emit(tmp);
+            }
             if self.sack_permitted {
                 let tmp = options; options = TcpOption::SackPermitted.emit(tmp);
             } else if self.ack_number.is_some() && self.sack_ranges.iter().any(|s| s.is_some()) {