Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / net / ipv4 / tcp_output.c
index 1fa683c..8165f5a 100644 (file)
@@ -468,11 +468,12 @@ static unsigned tcp_syn_options(struct sock *sk, struct sk_buff *skb,
        }
        if (likely(sysctl_tcp_window_scaling)) {
                opts->ws = tp->rx_opt.rcv_wscale;
-               size += TCPOLEN_WSCALE_ALIGNED;
+               if(likely(opts->ws))
+                       size += TCPOLEN_WSCALE_ALIGNED;
        }
        if (likely(sysctl_tcp_sack)) {
                opts->options |= OPTION_SACK_ADVERTISE;
-               if (unlikely(!OPTION_TS & opts->options))
+               if (unlikely(!(OPTION_TS & opts->options)))
                        size += TCPOLEN_SACKPERM_ALIGNED;
        }
 
@@ -509,7 +510,8 @@ static unsigned tcp_synack_options(struct sock *sk,
 
        if (likely(ireq->wscale_ok)) {
                opts->ws = ireq->rcv_wscale;
-               size += TCPOLEN_WSCALE_ALIGNED;
+               if(likely(opts->ws))
+                       size += TCPOLEN_WSCALE_ALIGNED;
        }
        if (likely(doing_ts)) {
                opts->options |= OPTION_TS;