Skip to content

Commit b32d131

Browse files
committed
tcp: Fix bitmask test in tcp_syn_options()
As reported by Alexey Dobriyan: CHECK net/ipv4/tcp_output.c net/ipv4/tcp_output.c:475:7: warning: dubious: !x & y And sparse is damn right! if (unlikely(!OPTION_TS & opts->options)) ^^^ size += TCPOLEN_SACKPERM_ALIGNED; OPTION_TS is (1 << 1), so condition will never trigger. Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ebb36a9 commit b32d131

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/ipv4/tcp_output.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static unsigned tcp_syn_options(struct sock *sk, struct sk_buff *skb,
472472
}
473473
if (likely(sysctl_tcp_sack)) {
474474
opts->options |= OPTION_SACK_ADVERTISE;
475-
if (unlikely(!OPTION_TS & opts->options))
475+
if (unlikely(!(OPTION_TS & opts->options)))
476476
size += TCPOLEN_SACKPERM_ALIGNED;
477477
}
478478

0 commit comments

Comments
 (0)