Subject: [PATCH v2] net-ipv4-tcp.c-fix-warning-for-older-compilers.patch

From: William Allen Simpson <[email-masked]>
Date: Fri, 11 Dec 2009 10:38:27 -0500

Replace + net-ipv4-tcpc-fix-warning.patch added to -mm tree

Remove the offending code, and replace with BUILD_BUG_ON().

Signed-off-by: [email-masked]
---
  net/ipv4/tcp.c |    5 +----
  1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c8666b7..3d2229c 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2541,10 +2541,7 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
 			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;
-			}
+			BUILD_BUG_ON(sizeof(ctd.tcpct_value) < TCP_COOKIE_PAIR_SIZE);
 			memcpy(&ctd.tcpct_value[0], &cvp->cookie_pair[0],
 			       cvp->cookie_pair_size);
 			ctd.tcpct_used = cvp->cookie_pair_size;
-- 
1.6.3.3