Skip to content

Commit

Permalink
tcp: Remove runtime check that can never be true.
Browse files Browse the repository at this point in the history
GCC even warns about it, as reported by Andrew Morton:

net/ipv4/tcp.c: In function 'do_tcp_getsockopt':
net/ipv4/tcp.c:2544: warning: comparison is always false due to limited range of data type

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Dec 9, 2009
1 parent e61444d commit 3dc7893
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2540,11 +2540,6 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
ctd.tcpct_cookie_desired = cvp->cookie_desired;
ctd.tcpct_s_data_desired = cvp->s_data_desired;

/* Cookie(s) saved, return as nonce */
if (sizeof(ctd.tcpct_value) < cvp->cookie_pair_size) {
/* impossible? */
return -EINVAL;
}
memcpy(&ctd.tcpct_value[0], &cvp->cookie_pair[0],
cvp->cookie_pair_size);
ctd.tcpct_used = cvp->cookie_pair_size;
Expand Down

0 comments on commit 3dc7893

Please sign in to comment.