Source-Changes-HG archive

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

[src/trunk]: src Correct the length of the SADB_EXT header in debug outputs



details:   https://anonhg.NetBSD.org/src/rev/5831894f53fe
branches:  trunk
changeset: 823500:5831894f53fe
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Wed Apr 26 03:16:06 2017 +0000

description:
Correct the length of the SADB_EXT header in debug outputs

The length is shifted 3 bits in PF_KEY protocol.

Originally fixed by hsuenaga@IIJ

diffstat:

 crypto/dist/ipsec-tools/src/libipsec/key_debug.c |  4 ++--
 sys/netipsec/key_debug.c                         |  6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 6250dd58da05 -r 5831894f53fe crypto/dist/ipsec-tools/src/libipsec/key_debug.c
--- a/crypto/dist/ipsec-tools/src/libipsec/key_debug.c  Wed Apr 26 03:04:24 2017 +0000
+++ b/crypto/dist/ipsec-tools/src/libipsec/key_debug.c  Wed Apr 26 03:16:06 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: key_debug.c,v 1.10 2012/01/09 15:25:13 drochner Exp $  */
+/*     $NetBSD: key_debug.c,v 1.11 2017/04/26 03:16:06 ozaki-r Exp $   */
 
 /*     $KAME: key_debug.c,v 1.29 2001/08/16 14:25:41 itojun Exp $      */
 
@@ -133,7 +133,7 @@
 
        while (tlen > 0) {
                printf("sadb_ext{ len=%u type=%u }\n",
-                   ext->sadb_ext_len, ext->sadb_ext_type);
+                   PFKEY_UNUNIT64(ext->sadb_ext_len), ext->sadb_ext_type);
 
                if (ext->sadb_ext_len == 0) {
                        printf("kdebug_sadb: invalid ext_len=0 was passed.\n");
diff -r 6250dd58da05 -r 5831894f53fe sys/netipsec/key_debug.c
--- a/sys/netipsec/key_debug.c  Wed Apr 26 03:04:24 2017 +0000
+++ b/sys/netipsec/key_debug.c  Wed Apr 26 03:16:06 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: key_debug.c,v 1.16 2017/04/18 10:49:35 ozaki-r Exp $   */
+/*     $NetBSD: key_debug.c,v 1.17 2017/04/26 03:16:06 ozaki-r Exp $   */
 /*     $FreeBSD: src/sys/netipsec/key_debug.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $  */
 /*     $KAME: key_debug.c,v 1.26 2001/06/27 10:46:50 sakane Exp $      */
 
@@ -33,7 +33,7 @@
 
 #ifdef _KERNEL
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key_debug.c,v 1.16 2017/04/18 10:49:35 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key_debug.c,v 1.17 2017/04/26 03:16:06 ozaki-r Exp $");
 #endif
 
 #if defined(_KERNEL_OPT)
@@ -105,7 +105,7 @@
 
        while (tlen > 0) {
                printf("sadb_ext{ len=%u type=%u }\n",
-                   ext->sadb_ext_len, ext->sadb_ext_type);
+                   PFKEY_UNUNIT64(ext->sadb_ext_len), ext->sadb_ext_type);
 
                if (ext->sadb_ext_len == 0) {
                        printf("kdebug_sadb: invalid ext_len=0 was passed.\n");



Home | Main Index | Thread Index | Old Index