Source-Changes-HG archive

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

[src/trunk]: src/sys Dedup: merge ipsec4_in_reject and ipsec6_in_reject into ...



details:   https://anonhg.NetBSD.org/src/rev/10b4e0add633
branches:  trunk
changeset: 830135:10b4e0add633
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Feb 26 09:04:29 2018 +0000

description:
Dedup: merge ipsec4_in_reject and ipsec6_in_reject into ipsec_in_reject.
While here fix misleading comment.

ok ozaki-r@

diffstat:

 sys/netinet/raw_ip.c                |   8 +++---
 sys/netinet/sctp_input.c            |   6 ++--
 sys/netinet/tcp_input.c             |  14 +++++-----
 sys/netinet/udp_usrreq.c            |   6 ++--
 sys/netinet6/icmp6.c                |   8 +++---
 sys/netinet6/raw_ip6.c              |   8 +++---
 sys/netinet6/sctp6_usrreq.c         |   6 ++--
 sys/netinet6/udp6_usrreq.c          |   6 ++--
 sys/netipsec/ipsec.c                |  48 +++++-------------------------------
 sys/netipsec/ipsec.h                |   4 +-
 sys/netipsec/ipsec6.h               |   4 +--
 sys/netipsec/ipsec_input.c          |   8 +++---
 sys/rump/librump/rumpnet/net_stub.c |   7 ++---
 13 files changed, 48 insertions(+), 85 deletions(-)

diffs (truncated from 470 to 300 lines):

diff -r 6bdc7013cf33 -r 10b4e0add633 sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c      Mon Feb 26 08:50:25 2018 +0000
+++ b/sys/netinet/raw_ip.c      Mon Feb 26 09:04:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: raw_ip.c,v 1.168 2018/02/14 16:45:24 christos Exp $    */
+/*     $NetBSD: raw_ip.c,v 1.169 2018/02/26 09:04:29 maxv Exp $        */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.168 2018/02/14 16:45:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.169 2018/02/26 09:04:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -204,7 +204,7 @@
                        ;
 #if defined(IPSEC)
                /* check AH/ESP integrity. */
-               else if (ipsec_used && ipsec4_in_reject(m, last)) {
+               else if (ipsec_used && ipsec_in_reject(m, last)) {
                        IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
                        /* do not inject data to pcb */
                }
@@ -218,7 +218,7 @@
        }
 #if defined(IPSEC)
        /* check AH/ESP integrity. */
-       if (ipsec_used && last != NULL && ipsec4_in_reject(m, last)) {
+       if (ipsec_used && last != NULL && ipsec_in_reject(m, last)) {
                m_freem(m);
                IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
                IP_STATDEC(IP_STAT_DELIVERED);
diff -r 6bdc7013cf33 -r 10b4e0add633 sys/netinet/sctp_input.c
--- a/sys/netinet/sctp_input.c  Mon Feb 26 08:50:25 2018 +0000
+++ b/sys/netinet/sctp_input.c  Mon Feb 26 09:04:29 2018 +0000
@@ -1,5 +1,5 @@
 /*     $KAME: sctp_input.c,v 1.28 2005/04/21 18:36:21 nishida Exp $    */
-/*     $NetBSD: sctp_input.c,v 1.7 2017/06/27 13:27:54 rjs Exp $       */
+/*     $NetBSD: sctp_input.c,v 1.8 2018/02/26 09:04:29 maxv Exp $      */
 
 /*
  * Copyright (C) 2002, 2003, 2004 Cisco Systems Inc,
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sctp_input.c,v 1.7 2017/06/27 13:27:54 rjs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_input.c,v 1.8 2018/02/26 09:04:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -4238,7 +4238,7 @@
         * I very much doubt any of the IPSEC stuff will work but I have
         * no idea, so I will leave it in place.
         */
-       if (ipsec_used && ipsec4_in_reject(m, (struct inpcb *)inp)) {
+       if (ipsec_used && ipsec_in_reject(m, (struct inpcb *)inp)) {
 #if 0
                ipsecstat.in_polvio++;
 #endif
diff -r 6bdc7013cf33 -r 10b4e0add633 sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c   Mon Feb 26 08:50:25 2018 +0000
+++ b/sys/netinet/tcp_input.c   Mon Feb 26 09:04:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_input.c,v 1.379 2018/02/12 08:22:26 maxv Exp $     */
+/*     $NetBSD: tcp_input.c,v 1.380 2018/02/26 09:04:29 maxv Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.379 2018/02/12 08:22:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.380 2018/02/26 09:04:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1460,14 +1460,14 @@
                if (ipsec_used) {
                        if (inp &&
                            (inp->inp_socket->so_options & SO_ACCEPTCONN) == 0
-                           && ipsec4_in_reject(m, inp)) {
+                           && ipsec_in_reject(m, inp)) {
                                IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
                                goto drop;
                        }
 #ifdef INET6
                        else if (in6p &&
                            (in6p->in6p_socket->so_options & SO_ACCEPTCONN) == 0
-                           && ipsec6_in_reject(m, in6p)) {
+                           && ipsec_in_reject(m, in6p)) {
                                IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
                                goto drop;
                        }
@@ -1505,7 +1505,7 @@
 #if defined(IPSEC)
                if (ipsec_used && in6p &&
                    (in6p->in6p_socket->so_options & SO_ACCEPTCONN) == 0 &&
-                   ipsec6_in_reject(m, in6p)) {
+                   ipsec_in_reject(m, in6p)) {
                        IPSEC6_STATINC(IPSEC_STAT_IN_POLVIO);
                        goto drop;
                }
@@ -1785,7 +1785,7 @@
                                         */
                                        KASSERT(inp == NULL ||
                                            sotoinpcb(so) == inp);
-                                       if (!ipsec4_in_reject(m, inp))
+                                       if (!ipsec_in_reject(m, inp))
                                                break;
                                        IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
                                        tp = NULL;
@@ -1794,7 +1794,7 @@
 #ifdef INET6
                                case AF_INET6:
                                        KASSERT(sotoin6pcb(so) == in6p);
-                                       if (!ipsec6_in_reject(m, in6p))
+                                       if (!ipsec_in_reject(m, in6p))
                                                break;
                                        IPSEC6_STATINC(IPSEC_STAT_IN_POLVIO);
                                        tp = NULL;
diff -r 6bdc7013cf33 -r 10b4e0add633 sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c  Mon Feb 26 08:50:25 2018 +0000
+++ b/sys/netinet/udp_usrreq.c  Mon Feb 26 09:04:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: udp_usrreq.c,v 1.242 2018/02/14 05:24:44 maxv Exp $    */
+/*     $NetBSD: udp_usrreq.c,v 1.243 2018/02/26 09:04:29 maxv Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.242 2018/02/14 05:24:44 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.243 2018/02/26 09:04:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -479,7 +479,7 @@
 
 #if defined(IPSEC)
        /* check AH/ESP integrity. */
-       if (ipsec_used && ipsec4_in_reject(m, inp)) {
+       if (ipsec_used && ipsec_in_reject(m, inp)) {
                IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
                if ((n = m_copypacket(m, M_DONTWAIT)) != NULL)
                        icmp_error(n, ICMP_UNREACH, ICMP_UNREACH_ADMIN_PROHIBIT,
diff -r 6bdc7013cf33 -r 10b4e0add633 sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c      Mon Feb 26 08:50:25 2018 +0000
+++ b/sys/netinet6/icmp6.c      Mon Feb 26 09:04:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icmp6.c,v 1.220 2018/02/12 12:52:12 maxv Exp $ */
+/*     $NetBSD: icmp6.c,v 1.221 2018/02/26 09:04:29 maxv Exp $ */
 /*     $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.220 2018/02/12 12:52:12 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.221 2018/02/26 09:04:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2008,7 +2008,7 @@
                         * Check AH/ESP integrity
                         */
                        if (!ipsec_used ||
-                           (ipsec_used && !ipsec6_in_reject(m, last)))
+                           (ipsec_used && !ipsec_in_reject(m, last)))
 #endif
                        if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) {
                                if (last->in6p_flags & IN6P_CONTROLOPTS)
@@ -2030,7 +2030,7 @@
        }
 
 #ifdef IPSEC
-       if (ipsec_used && last && ipsec6_in_reject(m, last)) {
+       if (ipsec_used && last && ipsec_in_reject(m, last)) {
                m_freem(m);
                IP6_STATDEC(IP6_STAT_DELIVERED);
                /* do not inject data into pcb */
diff -r 6bdc7013cf33 -r 10b4e0add633 sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c    Mon Feb 26 08:50:25 2018 +0000
+++ b/sys/netinet6/raw_ip6.c    Mon Feb 26 09:04:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: raw_ip6.c,v 1.162 2018/02/08 19:58:05 maxv Exp $       */
+/*     $NetBSD: raw_ip6.c,v 1.163 2018/02/26 09:04:29 maxv Exp $       */
 /*     $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $        */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.162 2018/02/08 19:58:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.163 2018/02/26 09:04:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -198,7 +198,7 @@
                         * Check AH/ESP integrity
                         */
                        if (!ipsec_used ||
-                           (ipsec_used && !ipsec6_in_reject(m, last)))
+                           (ipsec_used && !ipsec_in_reject(m, last)))
 #endif
                        if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) {
                                if (last->in6p_flags & IN6P_CONTROLOPTS)
@@ -221,7 +221,7 @@
        }
 
 #ifdef IPSEC
-       if (ipsec_used && last && ipsec6_in_reject(m, last)) {
+       if (ipsec_used && last && ipsec_in_reject(m, last)) {
                m_freem(m);
                IP6_STATDEC(IP6_STAT_DELIVERED);
                /* do not inject data into pcb */
diff -r 6bdc7013cf33 -r 10b4e0add633 sys/netinet6/sctp6_usrreq.c
--- a/sys/netinet6/sctp6_usrreq.c       Mon Feb 26 08:50:25 2018 +0000
+++ b/sys/netinet6/sctp6_usrreq.c       Mon Feb 26 09:04:29 2018 +0000
@@ -1,5 +1,5 @@
 /* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */
-/* $NetBSD: sctp6_usrreq.c,v 1.14 2017/10/17 19:23:42 rjs Exp $ */
+/* $NetBSD: sctp6_usrreq.c,v 1.15 2018/02/26 09:04:29 maxv Exp $ */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc.
@@ -33,7 +33,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sctp6_usrreq.c,v 1.14 2017/10/17 19:23:42 rjs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp6_usrreq.c,v 1.15 2018/02/26 09:04:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -235,7 +235,7 @@
        /*
         * Check AH/ESP integrity.
         */
-       if (ipsec_used && ipsec6_in_reject(m, (struct in6pcb *)in6p_ip)) {
+       if (ipsec_used && ipsec_in_reject(m, (struct in6pcb *)in6p_ip)) {
 /* XXX */
 #if 0
                /* FIX ME: need to find right stat */
diff -r 6bdc7013cf33 -r 10b4e0add633 sys/netinet6/udp6_usrreq.c
--- a/sys/netinet6/udp6_usrreq.c        Mon Feb 26 08:50:25 2018 +0000
+++ b/sys/netinet6/udp6_usrreq.c        Mon Feb 26 09:04:29 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udp6_usrreq.c,v 1.134 2018/02/08 19:58:05 maxv Exp $ */
+/* $NetBSD: udp6_usrreq.c,v 1.135 2018/02/26 09:04:29 maxv Exp $ */
 /* $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $ */
 /* $KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $ */
 
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.134 2018/02/08 19:58:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.135 2018/02/26 09:04:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -353,7 +353,7 @@
 
 #if defined(IPSEC)
        /* check AH/ESP integrity. */
-       if (ipsec_used && ipsec6_in_reject(m, in6p)) {
+       if (ipsec_used && ipsec_in_reject(m, in6p)) {
                IPSEC6_STATINC(IPSEC_STAT_IN_POLVIO);
                if ((n = m_copypacket(m, M_DONTWAIT)) != NULL)
                        icmp6_error(n, ICMP6_DST_UNREACH,
diff -r 6bdc7013cf33 -r 10b4e0add633 sys/netipsec/ipsec.c
--- a/sys/netipsec/ipsec.c      Mon Feb 26 08:50:25 2018 +0000
+++ b/sys/netipsec/ipsec.c      Mon Feb 26 09:04:29 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.138 2018/02/26 08:50:25 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.139 2018/02/26 09:04:29 maxv Exp $ */
 /* $FreeBSD: src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
 /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.138 2018/02/26 08:50:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.139 2018/02/26 09:04:29 maxv Exp $");
 
 /*
  * IPsec controller part.
@@ -1701,12 +1701,13 @@
 }



Home | Main Index | Thread Index | Old Index