Module Name:    src
Committed By:   knakahara
Date:           Tue Mar 13 03:05:13 UTC 2018

Modified Files:
        src/sys/netipsec: ipsecif.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/netipsec/ipsecif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/ipsecif.c
diff -u src/sys/netipsec/ipsecif.c:1.4 src/sys/netipsec/ipsecif.c:1.5
--- src/sys/netipsec/ipsecif.c:1.4	Fri Mar  9 11:05:21 2018
+++ src/sys/netipsec/ipsecif.c	Tue Mar 13 03:05:12 2018
@@ -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 @@ ipsecif6_output(struct ipsec_variant *va
 	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;

Reply via email to