Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/ipf/netinet PR/54443: Edgar Fuß: ip mistake...



details:   https://anonhg.NetBSD.org/src/rev/4a1fa99f9904
branches:  trunk
changeset: 964601:4a1fa99f9904
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 08 14:38:53 2019 +0000

description:
PR/54443: Edgar Fuß: ip mistakenly regards UDP packet with checksum field
0xffff as bad

diffstat:

 sys/external/bsd/ipf/netinet/fil.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 25933dd77c8d -r 4a1fa99f9904 sys/external/bsd/ipf/netinet/fil.c
--- a/sys/external/bsd/ipf/netinet/fil.c        Thu Aug 08 14:00:27 2019 +0000
+++ b/sys/external/bsd/ipf/netinet/fil.c        Thu Aug 08 14:38:53 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.29 2019/06/28 23:25:12 christos Exp $        */
+/*     $NetBSD: fil.c,v 1.30 2019/08/08 14:38:53 christos Exp $        */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -141,7 +141,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.29 2019/06/28 23:25:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.30 2019/08/08 14:38:53 christos Exp $");
 #else
 static const char sccsid[] = "@(#)fil.c        1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $";
@@ -6536,8 +6536,11 @@
                /*NOTREACHED*/
        }
 
-       if (csump != NULL)
+       if (csump != NULL) {
                hdrsum = *csump;
+               if (fin->fin_p == IPPROTO_UDP && hdrsum == 0xffff)
+                       hdrsum = 0x0000;
+       }
 
        if (dosum) {
                sum = fr_cksum(fin, fin->fin_ip, fin->fin_p, fin->fin_dp);



Home | Main Index | Thread Index | Old Index