Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec Fix kern/55066. Pointed out and fixed by Chuck...



details:   https://anonhg.NetBSD.org/src/rev/c9a071b3bb3a
branches:  trunk
changeset: 1008156:c9a071b3bb3a
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Mar 13 06:55:35 2020 +0000

description:
Fix kern/55066.  Pointed out and fixed by Chuck Zmudzinski, thanks.

ok'ed by ozaki-r@n.o

diffstat:

 sys/netipsec/key.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r fa17dbfc9b48 -r c9a071b3bb3a sys/netipsec/key.c
--- a/sys/netipsec/key.c        Fri Mar 13 05:49:52 2020 +0000
+++ b/sys/netipsec/key.c        Fri Mar 13 06:55:35 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: key.c,v 1.270 2020/02/07 12:35:33 thorpej Exp $        */
+/*     $NetBSD: key.c,v 1.271 2020/03/13 06:55:35 knakahara Exp $      */
 /*     $FreeBSD: key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */
 /*     $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $   */
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.270 2020/02/07 12:35:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.271 2020/03/13 06:55:35 knakahara Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -4770,7 +4770,7 @@
        case PORT_STRICT:
                if (port1 != port2) {
                        KEYDEBUG_PRINTF(KEYDEBUG_MATCH,
-                           "port fail %d != %d\n", port1, port2);
+                           "port fail %d != %d\n", ntohs(port1), ntohs(port2));
                        return 1;
                }
                return 0;
@@ -4822,9 +4822,9 @@
                KEYDEBUG_PRINTF(KEYDEBUG_MATCH,
                    "addr success %s[%d] == %s[%d]\n",
                    (in_print(s1, sizeof(s1), &sin1->sin_addr), s1),
-                   sin1->sin_port,
+                   ntohs(sin1->sin_port),
                    (in_print(s2, sizeof(s2), &sin2->sin_addr), s2),
-                   sin2->sin_port);
+                   ntohs(sin2->sin_port));
                break;
        case AF_INET6:
                sin61 = (const struct sockaddr_in6 *)sa1;



Home | Main Index | Thread Index | Old Index