From 4212d42b89aa413e227cf7d0434c752543874196 Mon Sep 17 00:00:00 2001 From: maxv Date: Fri, 12 Oct 2018 05:41:18 +0000 Subject: [PATCH] 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. --- sys/netinet/ip_reass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index 0d51d8aa2b72..c671e24cf6cc 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -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 -__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 #include @@ -402,6 +402,7 @@ insert: * 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);