Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Don't try to do PCB lookup for bad checksummed s...



details:   https://anonhg.NetBSD.org/src/rev/e27f46a23bc1
branches:  trunk
changeset: 338240:e27f46a23bc1
user:      kefren <kefren%NetBSD.org@localhost>
date:      Fri May 15 18:03:45 2015 +0000

description:
Don't try to do PCB lookup for bad checksummed segments
Fixes PR/43510 and PR/48452

diffstat:

 sys/netinet/tcp_input.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (44 lines):

diff -r d49d65dd6931 -r e27f46a23bc1 sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c   Fri May 15 17:43:35 2015 +0000
+++ b/sys/netinet/tcp_input.c   Fri May 15 18:03:45 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_input.c,v 1.339 2015/05/02 17:18:03 rtr Exp $      */
+/*     $NetBSD: tcp_input.c,v 1.340 2015/05/15 18:03:45 kefren Exp $   */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.339 2015/05/02 17:18:03 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.340 2015/05/15 18:03:45 kefren Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -1394,6 +1394,12 @@
        tiflags = th->th_flags;
 
        /*
+        * Checksum extended TCP header and data
+        */
+       if (tcp_input_checksum(af, m, th, toff, off, tlen))
+               goto badcsum;
+
+       /*
         * Locate pcb for segment.
         */
 findpcb:
@@ -1564,12 +1570,6 @@
        KASSERT(so->so_lock == softnet_lock);
        KASSERT(solocked(so));
 
-       /*
-        * Checksum extended TCP header and data.
-        */
-       if (tcp_input_checksum(af, m, th, toff, off, tlen))
-               goto badcsum;
-
        tcp_fields_to_host(th);
 
        /* Unscale the window into a 32-bit value. */



Home | Main Index | Thread Index | Old Index