Source-Changes-HG archive

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

[src/netbsd-7-0]: src/sys/netinet6 Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/3e487f8d67fa
branches:  netbsd-7-0
changeset: 801452:3e487f8d67fa
user:      snj <snj%NetBSD.org@localhost>
date:      Sun Feb 25 23:17:22 2018 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #1572):
        sys/netinet6/ip6_input.c: 1.188 via patch
Kick nested fragments.

diffstat:

 sys/netinet6/ip6_input.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r 519b73a6bf2d -r 3e487f8d67fa sys/netinet6/ip6_input.c
--- a/sys/netinet6/ip6_input.c  Sun Feb 25 21:16:33 2018 +0000
+++ b/sys/netinet6/ip6_input.c  Sun Feb 25 23:17:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_input.c,v 1.149.2.1.2.1 2018/01/30 18:31:53 martin Exp $   */
+/*     $NetBSD: ip6_input.c,v 1.149.2.1.2.2 2018/02/25 23:17:22 snj Exp $      */
 /*     $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $     */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.149.2.1.2.1 2018/01/30 18:31:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.149.2.1.2.2 2018/02/25 23:17:22 snj Exp $");
 
 #include "opt_gateway.h"
 #include "opt_inet.h"
@@ -249,7 +249,7 @@
        int hit, off = sizeof(struct ip6_hdr), nest;
        u_int32_t plen;
        u_int32_t rtalert = ~0;
-       int nxt, ours = 0, rh_present = 0;
+       int nxt, ours = 0, rh_present = 0, frg_present;
        struct ifnet *deliverifp = NULL;
        int srcrt = 0;
        const struct rtentry *rt;
@@ -720,6 +720,7 @@
        nest = 0;
 
        rh_present = 0;
+       frg_present = 0;
        while (nxt != IPPROTO_DONE) {
                if (ip6_hdrnestlimit && (++nest > ip6_hdrnestlimit)) {
                        IP6_STATINC(IP6_STAT_TOOMANYHDR);
@@ -744,6 +745,13 @@
                                IP6_STATINC(IP6_STAT_BADOPTIONS);
                                goto bad;
                        }
+               } else if (nxt == IPPROTO_FRAGMENT) {
+                       if (frg_present++) {
+                               in6_ifstat_inc(m->m_pkthdr.rcvif,
+                                   ifs6_in_hdrerr);
+                               IP6_STATINC(IP6_STAT_BADOPTIONS);
+                               goto bad;
+                       }
                }
 
 #ifdef IPSEC



Home | Main Index | Thread Index | Old Index