Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/netipsec Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/2909f5219d72
branches:  netbsd-9
changeset: 963584:2909f5219d72
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jan 31 11:30:24 2020 +0000

description:
Pull up following revision(s) (requested by knakahara in ticket #679):

        sys/netipsec/ipsecif.c: revision 1.19

Fix IPv6 over IPv4 ipsecif(4) uses IPv4 SP wrongly.  Pointed out by ohishi@IIJ.
XXX pullup-8, pullup-9

diffstat:

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

diffs (37 lines):

diff -r a99dcfe63907 -r 2909f5219d72 sys/netipsec/ipsecif.c
--- a/sys/netipsec/ipsecif.c    Fri Jan 31 11:28:38 2020 +0000
+++ b/sys/netipsec/ipsecif.c    Fri Jan 31 11:30:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsecif.c,v 1.16.2.1 2019/09/24 03:10:35 martin Exp $  */
+/*     $NetBSD: ipsecif.c,v 1.16.2.2 2020/01/31 11:30:24 martin Exp $  */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.16.2.1 2019/09/24 03:10:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.16.2.2 2020/01/31 11:30:24 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -380,7 +380,17 @@
        KASSERT(var->iv_psrc->sa_family == AF_INET);
        KASSERT(var->iv_pdst->sa_family == AF_INET);
 
-       sp = IV_SP_OUT(var);
+       switch (family) {
+       case AF_INET:
+               sp = IV_SP_OUT(var);
+               break;
+       case AF_INET6:
+               sp = IV_SP_OUT6(var);
+               break;
+       default:
+               m_freem(m);
+               return EAFNOSUPPORT;
+       }
        KASSERT(sp != NULL);
        /*
         * The SPs in ipsec_variant are prevented from freed by



Home | Main Index | Thread Index | Old Index