Source-Changes-HG archive

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

src: Remove misleading comment; we're just checking the SP, not ...



details:   https://anonhg.NetBSD.org/src/rev/86aecb8dc29a
branches:  trunk
changeset: 318091:86aecb8dc29a
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Apr 12 06:49:39 2018 +0000
description:
Remove misleading comment; we're just checking the SP, not verifying the
AH/ESP payload. While here style a bit.

diffstat:

 sys/netinet/raw_ip.c       |  19 ++++++++++---------
 sys/netinet/udp_usrreq.c   |   5 ++---
 sys/netinet6/icmp6.c       |   7 ++-----
 sys/netinet6/raw_ip6.c     |   7 ++-----
 sys/netinet6/udp6_usrreq.c |   5 ++---
 5 files changed, 18 insertions(+), 25 deletions(-)

diffs (173 lines):

diff -r 6df618584507 -r 86aecb8dc29a sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c      Thu Apr 12 04:38:13 2018 +0000
+++ b/sys/netinet/raw_ip.c      Thu Apr 12 06:49:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: raw_ip.c,v 1.172 2018/03/21 14:23:54 roy Exp $ */
+/*     $NetBSD: raw_ip.c,v 1.173 2018/04/12 06:49:39 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.172 2018/03/21 14:23:54 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.173 2018/04/12 06:49:39 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -202,11 +202,10 @@
                if (last == NULL)
                        ;
 #if defined(IPSEC)
-               /* check AH/ESP integrity. */
                else if (ipsec_used && ipsec_in_reject(m, last)) {
                        /* do not inject data to pcb */
                }
-#endif /*IPSEC*/
+#endif
                else if ((n = m_copypacket(m, M_DONTWAIT)) != NULL) {
                        rip_sbappendaddr(last, ip, sintosa(&ripsrc), hlen, opts,
                            n);
@@ -214,17 +213,17 @@
                }
                last = inp;
        }
+
 #if defined(IPSEC)
-       /* check AH/ESP integrity. */
        if (ipsec_used && last != NULL && ipsec_in_reject(m, last)) {
                m_freem(m);
                IP_STATDEC(IP_STAT_DELIVERED);
                /* do not inject data to pcb */
        } else
-#endif /*IPSEC*/
-       if (last != NULL)
+#endif
+       if (last != NULL) {
                rip_sbappendaddr(last, ip, sintosa(&ripsrc), hlen, opts, m);
-       else if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) {
+       } else if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) {
                uint64_t *ips;
 
                icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PROTOCOL,
@@ -233,8 +232,10 @@
                ips[IP_STAT_NOPROTO]++;
                ips[IP_STAT_DELIVERED]--;
                IP_STAT_PUTREF();
-       } else
+       } else {
                m_freem(m);
+       }
+
        return;
 }
 
diff -r 6df618584507 -r 86aecb8dc29a sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c  Thu Apr 12 04:38:13 2018 +0000
+++ b/sys/netinet/udp_usrreq.c  Thu Apr 12 06:49:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: udp_usrreq.c,v 1.246 2018/03/19 16:26:25 roy Exp $     */
+/*     $NetBSD: udp_usrreq.c,v 1.247 2018/04/12 06:49:39 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.246 2018/03/19 16:26:25 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.247 2018/04/12 06:49:39 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -477,7 +477,6 @@
        KASSERT(inp != NULL);
 
 #if defined(IPSEC)
-       /* check AH/ESP integrity. */
        if (ipsec_used && ipsec_in_reject(m, inp)) {
                if ((n = m_copypacket(m, M_DONTWAIT)) != NULL)
                        icmp_error(n, ICMP_UNREACH, ICMP_UNREACH_ADMIN_PROHIBIT,
diff -r 6df618584507 -r 86aecb8dc29a sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c      Thu Apr 12 04:38:13 2018 +0000
+++ b/sys/netinet6/icmp6.c      Thu Apr 12 06:49:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icmp6.c,v 1.224 2018/03/21 14:23:54 roy Exp $  */
+/*     $NetBSD: icmp6.c,v 1.225 2018/04/12 06:49:39 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.224 2018/03/21 14:23:54 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.225 2018/04/12 06:49:39 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2002,9 +2002,6 @@
                if (last) {
                        struct  mbuf *n;
 #ifdef IPSEC
-                       /*
-                        * Check AH/ESP integrity
-                        */
                        if (!ipsec_used || !ipsec_in_reject(m, last))
 #endif
                        if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) {
diff -r 6df618584507 -r 86aecb8dc29a sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c    Thu Apr 12 04:38:13 2018 +0000
+++ b/sys/netinet6/raw_ip6.c    Thu Apr 12 06:49:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: raw_ip6.c,v 1.166 2018/03/21 14:23:54 roy Exp $        */
+/*     $NetBSD: raw_ip6.c,v 1.167 2018/04/12 06:49:39 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.166 2018/03/21 14:23:54 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.167 2018/04/12 06:49:39 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -193,9 +193,6 @@
                        struct  mbuf *n;
 
 #ifdef IPSEC
-                       /*
-                        * Check AH/ESP integrity
-                        */
                        if (!ipsec_used || !ipsec_in_reject(m, last))
 #endif
                        if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) {
diff -r 6df618584507 -r 86aecb8dc29a sys/netinet6/udp6_usrreq.c
--- a/sys/netinet6/udp6_usrreq.c        Thu Apr 12 04:38:13 2018 +0000
+++ b/sys/netinet6/udp6_usrreq.c        Thu Apr 12 06:49:39 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udp6_usrreq.c,v 1.138 2018/03/19 16:26:25 roy Exp $ */
+/* $NetBSD: udp6_usrreq.c,v 1.139 2018/04/12 06:49:39 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.138 2018/03/19 16:26:25 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.139 2018/04/12 06:49:39 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -351,7 +351,6 @@
        KASSERT(in6p != NULL);
 
 #if defined(IPSEC)
-       /* check AH/ESP integrity. */
        if (ipsec_used && ipsec_in_reject(m, in6p)) {
                if ((n = m_copypacket(m, M_DONTWAIT)) != NULL)
                        icmp6_error(n, ICMP6_DST_UNREACH,



Home | Main Index | Thread Index | Old Index