Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec comment out confusing (and incorrect) code and ...



details:   https://anonhg.NetBSD.org/src/rev/9a82f0b8f67d
branches:  trunk
changeset: 321350:9a82f0b8f67d
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Tue Mar 13 03:05:12 2018 +0000

description:
comment out confusing (and incorrect) code and add comment. Pointed out by maxv@n.o, thanks.

diffstat:

 sys/netipsec/ipsecif.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r f46ad783635f -r 9a82f0b8f67d sys/netipsec/ipsecif.c
--- a/sys/netipsec/ipsecif.c    Tue Mar 13 03:03:33 2018 +0000
+++ b/sys/netipsec/ipsecif.c    Tue Mar 13 03:05:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsecif.c,v 1.4 2018/03/09 11:05:21 knakahara Exp $  */
+/*     $NetBSD: ipsecif.c,v 1.5 2018/03/13 03:05:12 knakahara Exp $  */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.4 2018/03/09 11:05:21 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.5 2018/03/13 03:05:12 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -483,7 +483,9 @@
        ip6->ip6_flow   = 0;
        ip6->ip6_vfc    &= ~IPV6_VERSION_MASK;
        ip6->ip6_vfc    |= IPV6_VERSION;
-       ip6->ip6_plen   = htons((u_short)m->m_pkthdr.len);
+#if 0  /* ip6->ip6_plen will be filled by ip6_output */
+       ip6->ip6_plen   = htons((u_short)m->m_pkthdr.len - sizeof(*ip6));
+#endif
        ip6->ip6_nxt    = proto;
        ip6->ip6_hlim   = ip6_ipsec_hlim;
        ip6->ip6_src    = sin6_src->sin6_addr;



Home | Main Index | Thread Index | Old Index