Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/netinet6 Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/9c01f1d14cb8
branches:  netbsd-8
changeset: 434788:9c01f1d14cb8
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Mar 30 11:19:45 2018 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #663):

        sys/netinet6/frag6.c: revision 1.64

Kick zero-sized fragments. We can't allow them to enter; two fragments
could be put at the same offset.

diffstat:

 sys/netinet6/frag6.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 9a590f437681 -r 9c01f1d14cb8 sys/netinet6/frag6.c
--- a/sys/netinet6/frag6.c      Fri Mar 30 11:17:19 2018 +0000
+++ b/sys/netinet6/frag6.c      Fri Mar 30 11:19:45 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frag6.c,v 1.60.6.2 2018/01/30 18:21:09 martin Exp $    */
+/*     $NetBSD: frag6.c,v 1.60.6.3 2018/03/30 11:19:45 martin Exp $    */
 /*     $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.60.6.2 2018/01/30 18:21:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.60.6.3 2018/03/30 11:19:45 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -152,13 +152,14 @@
        }
 
        /*
-        * check whether fragment packet's fragment length is
+        * Check whether fragment packet's fragment length is non-zero and
         * multiple of 8 octets.
         * sizeof(struct ip6_frag) == 8
         * sizeof(struct ip6_hdr) = 40
         */
        if ((ip6f->ip6f_offlg & IP6F_MORE_FRAG) &&
-           (((ntohs(ip6->ip6_plen) - offset) & 0x7) != 0)) {
+           (((ntohs(ip6->ip6_plen) - offset) == 0) ||
+            ((ntohs(ip6->ip6_plen) - offset) & 0x7) != 0)) {
                icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
                    offsetof(struct ip6_hdr, ip6_plen));
                in6_ifstat_inc(dstifp, ifs6_reass_fail);



Home | Main Index | Thread Index | Old Index