Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Force ip_off to zero when the reassembly is comp...



details:   https://anonhg.NetBSD.org/src/rev/83a1e00f6ab0
branches:  trunk
changeset: 993943:83a1e00f6ab0
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Oct 12 05:41:18 2018 +0000

description:
Force ip_off to zero when the reassembly is complete. This was lost in my
rev1.19 - before that the IP struct was clobbered for the reassembly, but
it actually implicitly guaranteed that the first fragment of the packet
would end up with ip_off = 0, and this was a desired behavior.

diffstat:

 sys/netinet/ip_reass.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 2b00ac4b4a38 -r 83a1e00f6ab0 sys/netinet/ip_reass.c
--- a/sys/netinet/ip_reass.c    Fri Oct 12 05:06:05 2018 +0000
+++ b/sys/netinet/ip_reass.c    Fri Oct 12 05:41:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_reass.c,v 1.20 2018/09/17 08:11:27 maxv Exp $       */
+/*     $NetBSD: ip_reass.c,v 1.21 2018/10/12 05:41:18 maxv Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.20 2018/09/17 08:11:27 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.21 2018/10/12 05:41:18 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -402,6 +402,7 @@
         * header visible.
         */
        ip->ip_len = htons((ip->ip_hl << 2) + next);
+       ip->ip_off = htons(0);
        ip->ip_src = fp->ipq_src;
        ip->ip_dst = fp->ipq_dst;
        free(fp, M_FTABLE);



Home | Main Index | Thread Index | Old Index