netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Allen Simpson <william.allen.simpson@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: davem@davemloft.net,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH] net-ipv4-tcp.c-fix-warning-from-older-compilers.patch
Date: Thu, 10 Dec 2009 09:16:20 -0500	[thread overview]
Message-ID: <4B2102B4.7050702@gmail.com> (raw)
In-Reply-To: <4B20FC2E.7050809@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

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

Remove the offending code, and replace with comments.  This is an
unlikely problem, so depend on human finding any future error.

Signed-off-by: William.Allen.Simpson@gmail.com
---
  net/ipv4/tcp.c |    9 ++++-----
  1 files changed, 4 insertions(+), 5 deletions(-)

[-- Attachment #2: net-ipv4-tcp.c-fix-warning-from-older-compilers.patch --]
[-- Type: text/plain, Size: 761 bytes --]

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c8666b7..3782c17 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2540,11 +2540,10 @@ 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;
-			}
+			/* Cookie(s) saved, return as nonce.
+			 * Assumes TCP_MSS_DEFAULT > TCP_COOKIE_PAIR_SIZE,
+			 * sizeof(ctd.tcpct_value) > cvp->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


  reply	other threads:[~2009-12-10 14:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200912090045.nB90jTaO010647@imap1.linux-foundation.org>
2009-12-09  1:45 ` + net-ipv4-tcpc-fix-warning.patch added to -mm tree William Allen Simpson
2009-12-09  2:08   ` Andrew Morton
2009-12-09  4:07     ` David Miller
2009-12-10 13:48     ` William Allen Simpson
2009-12-10 14:16       ` William Allen Simpson [this message]
2009-12-10 14:31         ` [PATCH] net-ipv4-tcp.c-fix-warning-from-older-compilers.patch Ben Hutchings
2009-12-11 15:30           ` William Allen Simpson
2009-12-11 15:38             ` [PATCH v2] net-ipv4-tcp.c-fix-warning-for-older-compilers.patch William Allen Simpson
2009-12-10 15:31         ` [PATCH] net-ipv4-tcp.c-fix-warning-from-older-compilers.patch Eric Dumazet
2009-12-10 21:46           ` David Miller
2009-12-11  6:50             ` Jarek Poplawski
2009-12-11 15:51               ` William Allen Simpson
2009-12-11 19:25                 ` Jarek Poplawski
2009-12-11 22:25                 ` David Miller
2009-12-11 15:49           ` William Allen Simpson
2009-12-11 22:24             ` David Miller
2009-12-10 21:43         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B2102B4.7050702@gmail.com \
    --to=william.allen.simpson@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).