Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/external/bsd/ipf/netinet Pull up following revision(s...



details:   https://anonhg.NetBSD.org/src/rev/286f0a61c559
branches:  netbsd-9
changeset: 1001644:286f0a61c559
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Apr 12 08:39:42 2020 +0000

description:
Pull up following revision(s) (requested by christos in ticket #827):

        sys/external/bsd/ipf/netinet/fil.c: revision 1.32
        sys/external/bsd/ipf/netinet/fil.c: revision 1.33
        sys/external/bsd/ipf/netinet/ip_frag.c: revision 1.8

PR/55137: Kouichi Hashikawa: ipfstat -f incorrect output
Fix incorrect byte order.

PR/55137: Kouichi Hashikawa: ipfstat -f incorrect output
- make sure frag is initialized to 0
- initialize ipfr_p field

PR/55149: Kouichi Hashikawa: Get morefrag before we strip it out from off

diffstat:

 sys/external/bsd/ipf/netinet/fil.c     |  9 ++++-----
 sys/external/bsd/ipf/netinet/ip_frag.c |  8 ++++++--
 2 files changed, 10 insertions(+), 7 deletions(-)

diffs (90 lines):

diff -r dec6694566cc -r 286f0a61c559 sys/external/bsd/ipf/netinet/fil.c
--- a/sys/external/bsd/ipf/netinet/fil.c        Sun Apr 12 08:35:40 2020 +0000
+++ b/sys/external/bsd/ipf/netinet/fil.c        Sun Apr 12 08:39:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.29.2.2 2019/10/03 17:18:32 martin Exp $      */
+/*     $NetBSD: fil.c,v 1.29.2.3 2020/04/12 08:39:42 martin 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.2.2 2019/10/03 17:18:32 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.29.2.3 2020/04/12 08:39:42 martin 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 $";
@@ -1696,7 +1696,7 @@
        fi->fi_p = p;
        fin->fin_crc = p;
        fi->fi_tos = ip->ip_tos;
-       fin->fin_id = ip->ip_id;
+       fin->fin_id = ntohs(ip->ip_id);
        off = ntohs(ip->ip_off);
 
        /* Get both TTL and protocol */
@@ -1724,11 +1724,10 @@
         */
        off &= IP_MF|IP_OFFMASK;
        if (off != 0) {
+               int morefrag = off & IP_MF;
                fi->fi_flx |= FI_FRAG;
                off &= IP_OFFMASK;
                if (off != 0) {
-                       int morefrag = off & IP_MF;
-
                        if (off == 1 && p == IPPROTO_TCP) {
                                fin->fin_flx |= FI_SHORT;       /* RFC 3128 */
                                DT1(ipf_fi_tcp_frag_off_1, fr_info_t *, fin);
diff -r dec6694566cc -r 286f0a61c559 sys/external/bsd/ipf/netinet/ip_frag.c
--- a/sys/external/bsd/ipf/netinet/ip_frag.c    Sun Apr 12 08:35:40 2020 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_frag.c    Sun Apr 12 08:39:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_frag.c,v 1.7 2018/06/03 10:37:23 maxv Exp $ */
+/*     $NetBSD: ip_frag.c,v 1.7.6.1 2020/04/12 08:39:42 martin Exp $   */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -86,7 +86,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_frag.c,v 1.7 2018/06/03 10:37:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_frag.c,v 1.7.6.1 2020/04/12 08:39:42 martin Exp $");
 #else
 static const char sccsid[] = "@(#)ip_frag.c    1.11 3/24/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_frag.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -393,6 +393,7 @@
                }
        }
 
+       memset(&frag, 0, sizeof(frag));
        frag.ipfr_v = fin->fin_v;
        idx = fin->fin_v;
        frag.ipfr_p = fin->fin_p;
@@ -441,6 +442,7 @@
                FBUMPD(ifs_nomem);
                return NULL;
        }
+       memset(fran, 0, sizeof(*fran));
 
        WRITE_ENTER(lock);
 
@@ -478,6 +480,7 @@
        table[idx] = fra;
        bcopy((char *)&frag.ipfr_ifp, (char *)&fra->ipfr_ifp, IPFR_CMPSZ);
        fra->ipfr_v = fin->fin_v;
+       fra->ipfr_p = fin->fin_p;
        fra->ipfr_ttl = softc->ipf_ticks + softf->ipfr_ttl;
        fra->ipfr_firstend = frag.ipfr_firstend;
 
@@ -655,6 +658,7 @@
         *
         * build up a hash value to index the table with.
         */
+       memset(&frag, 0, sizeof(frag));
        frag.ipfr_v = fin->fin_v;
        idx = fin->fin_v;
        frag.ipfr_p = fin->fin_p;



Home | Main Index | Thread Index | Old Index