Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/netinet6 pullup (approved by releng-1-5)



details:   https://anonhg.NetBSD.org/src/rev/8f92fd8dcd6e
branches:  netbsd-1-5
changeset: 489649:8f92fd8dcd6e
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Oct 02 23:41:31 2000 +0000

description:
pullup (approved by releng-1-5)
correct ipsecstat/ipsec6stat mixup.

netinet6/ah_input.c 1.18 -> 1.19
netinet6/ah_output.c 1.11 -> 1.12 (part of)
netinet6/esp_input.c 1.8 -> 1.9 (part of)
netinet6/esp_output.c 1.8 -> 1.9
netinet6/icmp6.c 1.43 -> 1.44
netinet6/ipcomp_input.c 1.13 -> 1.14
netinet6/ipcomp_output.c 1.13 -> 1.14

diffstat:

 sys/netinet6/ah_input.c      |   8 ++--
 sys/netinet6/ah_output.c     |   4 +-
 sys/netinet6/esp_input.c     |   4 +-
 sys/netinet6/esp_output.c    |  68 ++++++++-------------------------------
 sys/netinet6/icmp6.c         |   6 +-
 sys/netinet6/ipcomp_input.c  |   6 +-
 sys/netinet6/ipcomp_output.c |  75 ++++++-------------------------------------
 7 files changed, 39 insertions(+), 132 deletions(-)

diffs (truncated from 371 to 300 lines):

diff -r 8ef1d522b210 -r 8f92fd8dcd6e sys/netinet6/ah_input.c
--- a/sys/netinet6/ah_input.c   Mon Oct 02 22:23:32 2000 +0000
+++ b/sys/netinet6/ah_input.c   Mon Oct 02 23:41:31 2000 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: ah_input.c,v 1.15.2.3 2000/08/16 14:14:17 itojun Exp $ */
-/*     $KAME: ah_input.c,v 1.30 2000/07/15 16:07:48 itojun Exp $       */
+/*     $NetBSD: ah_input.c,v 1.15.2.4 2000/10/02 23:41:31 itojun Exp $ */
+/*     $KAME: ah_input.c,v 1.34 2000/10/01 12:37:18 itojun Exp $       */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -590,7 +590,7 @@
        IP6_EXTHDR_GET(ah, struct ah *, m, off, sizeof(struct newah));
        if (ah == NULL) {
                ipseclog((LOG_DEBUG, "IPv6 AH input: can't pullup\n"));
-               ipsecstat.in_inval++;
+               ipsec6stat.in_inval++;
                return IPPROTO_DONE;
        }
 #endif
@@ -674,7 +674,7 @@
                sizeof(struct ah) + sizoff + siz1);
        if (ah == NULL) {
                ipseclog((LOG_NOTICE, "couldn't pullup gather IPv6 AH checksum part"));
-               ipsecstat.in_inval++;
+               ipsec6stat.in_inval++;
                m = NULL;
                goto fail;
        }
diff -r 8ef1d522b210 -r 8f92fd8dcd6e sys/netinet6/ah_output.c
--- a/sys/netinet6/ah_output.c  Mon Oct 02 22:23:32 2000 +0000
+++ b/sys/netinet6/ah_output.c  Mon Oct 02 23:41:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ah_output.c,v 1.9.2.1 2000/07/25 04:24:47 itojun Exp $ */
+/*     $NetBSD: ah_output.c,v 1.9.2.2 2000/10/02 23:41:31 itojun Exp $ */
 /*     $KAME: ah_output.c,v 1.23 2000/07/15 16:07:48 itojun Exp $      */
 
 /*
@@ -459,7 +459,7 @@
                                ipseclog((LOG_WARNING,
                                    "replay counter overflowed. %s\n",
                                    ipsec_logsastr(sav)));
-                               ipsecstat.out_inval++;
+                               ipsec6stat.out_inval++;
                                m_freem(m);
                                return EINVAL;
                        }
diff -r 8ef1d522b210 -r 8f92fd8dcd6e sys/netinet6/esp_input.c
--- a/sys/netinet6/esp_input.c  Mon Oct 02 22:23:32 2000 +0000
+++ b/sys/netinet6/esp_input.c  Mon Oct 02 23:41:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: esp_input.c,v 1.1.1.1.2.4 2000/09/29 06:42:42 itojun Exp $     */
+/*     $NetBSD: esp_input.c,v 1.1.1.1.2.5 2000/10/02 23:41:32 itojun Exp $     */
 /*     $KAME: esp_input.c,v 1.33 2000/09/12 08:51:49 itojun Exp $      */
 
 /*
@@ -644,7 +644,7 @@
         * pre-compute and cache intermediate key
         */
        if (esp_schedule(algo, sav) != 0) {
-               ipsecstat.in_inval++;
+               ipsec6stat.in_inval++;
                goto bad;
        }
 
diff -r 8ef1d522b210 -r 8f92fd8dcd6e sys/netinet6/esp_output.c
--- a/sys/netinet6/esp_output.c Mon Oct 02 22:23:32 2000 +0000
+++ b/sys/netinet6/esp_output.c Mon Oct 02 23:41:31 2000 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: esp_output.c,v 1.1.1.1.2.4 2000/09/29 06:42:42 itojun Exp $    */
-/*     $KAME: esp_output.c,v 1.33 2000/09/19 15:15:12 itojun Exp $     */
+/*     $NetBSD: esp_output.c,v 1.1.1.1.2.5 2000/10/02 23:41:32 itojun Exp $    */
+/*     $KAME: esp_output.c,v 1.34 2000/10/01 12:37:19 itojun Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -187,16 +187,19 @@
        int afnumber;
        size_t extendsiz;
        int error = 0;
+       struct ipsecstat *stat;
 
        switch (af) {
 #ifdef INET
        case AF_INET:
                afnumber = 4;
+               stat = &ipsecstat;
                break;
 #endif
 #ifdef INET6
        case AF_INET6:
                afnumber = 6;
+               stat = &ipsec6stat;
                break;
 #endif
        default:
@@ -383,7 +386,7 @@
                                ipseclog((LOG_WARNING,
                                    "replay counter overflowed. %s\n",
                                    ipsec_logsastr(sav)));
-                               ipsecstat.out_inval++;
+                               stat->out_inval++;
                                m_freem(m);
                                return EINVAL;
                        }
@@ -501,7 +504,7 @@
        error = esp_schedule(algo, sav);
        if (error) {
                m_freem(m);
-               ipsecstat.in_inval++;
+               stat->out_inval++;
                goto fail;
        }
 
@@ -514,18 +517,7 @@
        if ((*algo->encrypt)(m, espoff, plen + extendsiz, sav, algo, ivlen)) {
                /* m is already freed */
                ipseclog((LOG_ERR, "packet encryption failure\n"));
-               switch (af) {
-#ifdef INET
-               case AF_INET:
-                       ipsecstat.out_inval++;
-                       break;
-#endif
-#ifdef INET6
-               case AF_INET6:
-                       ipsec6stat.out_inval++;
-                       break;
-#endif
-               }
+               stat->out_inval++;
                error = EINVAL;
                goto fail;
        }
@@ -546,7 +538,9 @@
        struct mbuf *n;
        u_char *p;
        size_t siz;
+#ifdef INET
        struct ip *ip;
+#endif
 
        aalgo = ah_algorithm_lookup(sav->alg_auth);
        if (!aalgo)
@@ -559,18 +553,7 @@
                ipseclog((LOG_ERR, "ESP checksum generation failure\n"));
                m_freem(m);
                error = EINVAL;
-               switch (af) {
-#ifdef INET
-               case AF_INET:
-                       ipsecstat.out_inval++;
-                       break;
-#endif
-#ifdef INET6
-               case AF_INET6:
-                       ipsec6stat.out_inval++;
-                       break;
-#endif
-               }
+               stat->out_inval++;
                goto fail;
        }
 
@@ -631,32 +614,9 @@
        if (!m) {
                ipseclog((LOG_ERR,
                    "NULL mbuf after encryption in esp%d_output", afnumber));
-       } else {
-               switch (af) {
-#ifdef INET
-               case AF_INET:
-                       ipsecstat.out_success++;
-                       break;
-#endif
-#ifdef INET6
-               case AF_INET6:
-                       ipsec6stat.out_success++;
-                       break;
-#endif
-               }
-       }
-       switch (af) {
-#ifdef INET
-       case AF_INET:
-               ipsecstat.out_esphist[sav->alg_enc]++;
-               break;
-#endif
-#ifdef INET6
-       case AF_INET6:
-               ipsec6stat.out_esphist[sav->alg_enc]++;
-               break;
-#endif
-       }
+       } else
+               stat->out_success++;
+       stat->out_esphist[sav->alg_enc]++;
        key_sa_recordxfer(sav, m);
        return 0;
 
diff -r 8ef1d522b210 -r 8f92fd8dcd6e sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c      Mon Oct 02 22:23:32 2000 +0000
+++ b/sys/netinet6/icmp6.c      Mon Oct 02 23:41:31 2000 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: icmp6.c,v 1.33.2.4 2000/09/19 19:52:25 itojun Exp $    */
-/*     $KAME: icmp6.c,v 1.144 2000/09/15 08:10:45 jinmei Exp $ */
+/*     $NetBSD: icmp6.c,v 1.33.2.5 2000/10/02 23:41:32 itojun Exp $    */
+/*     $KAME: icmp6.c,v 1.146 2000/10/01 12:37:20 itojun Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -358,7 +358,7 @@
 #ifdef IPSEC
        /* drop it if it does not match the default policy */
        if (ipsec6_in_reject(m, NULL)) {
-               ipsecstat.in_polvio++;
+               ipsec6stat.in_polvio++;
                goto freeit;
        }
 #endif
diff -r 8ef1d522b210 -r 8f92fd8dcd6e sys/netinet6/ipcomp_input.c
--- a/sys/netinet6/ipcomp_input.c       Mon Oct 02 22:23:32 2000 +0000
+++ b/sys/netinet6/ipcomp_input.c       Mon Oct 02 23:41:31 2000 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: ipcomp_input.c,v 1.10.4.1 2000/09/29 06:42:42 itojun Exp $     */
-/*     $KAME: ipcomp_input.c,v 1.18 2000/09/26 07:55:14 itojun Exp $   */
+/*     $NetBSD: ipcomp_input.c,v 1.10.4.2 2000/10/02 23:41:32 itojun Exp $     */
+/*     $KAME: ipcomp_input.c,v 1.19 2000/10/01 12:37:20 itojun Exp $   */
 
 /*
  * Copyright (C) 1999 WIDE Project.
@@ -257,7 +257,7 @@
                m = NULL;       /*already freed*/
                ipseclog((LOG_DEBUG, "IPv6 IPComp input: assumption failed "
                    "(pulldown failure)\n"));
-               ipsecstat.in_inval++;
+               ipsec6stat.in_inval++;
                goto fail;
        }
        ipcomp = mtod(md, struct ipcomp *);
diff -r 8ef1d522b210 -r 8f92fd8dcd6e sys/netinet6/ipcomp_output.c
--- a/sys/netinet6/ipcomp_output.c      Mon Oct 02 22:23:32 2000 +0000
+++ b/sys/netinet6/ipcomp_output.c      Mon Oct 02 23:41:31 2000 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: ipcomp_output.c,v 1.10.4.1 2000/09/29 06:42:42 itojun Exp $    */
-/*     $KAME: ipcomp_output.c,v 1.19 2000/09/26 07:55:14 itojun Exp $  */
+/*     $NetBSD: ipcomp_output.c,v 1.10.4.2 2000/10/02 23:41:32 itojun Exp $    */
+/*     $KAME: ipcomp_output.c,v 1.20 2000/10/01 12:37:20 itojun Exp $  */
 
 /*
  * Copyright (C) 1999 WIDE Project.
@@ -116,16 +116,19 @@
        size_t compoff;
        int afnumber;
        int error = 0;
+       struct ipsecstat *stat;
 
        switch (af) {
 #ifdef INET
        case AF_INET:
                afnumber = 4;
+               stat = &ipsecstat;
                break;
 #endif
 #ifdef INET6
        case AF_INET6:
                afnumber = 6;
+               stat = &ipsec6stat;
                break;
 #endif
        default:
@@ -136,7 +139,7 @@
        /* grab parameters */
        algo = ipcomp_algorithm_lookup(sav->alg_enc);
        if ((ntohl(sav->spi) & ~0xffff) != 0 || !algo) {
-               ipsecstat.out_inval++;
+               stat->out_inval++;
                m_freem(m);
                return EINVAL;
        }
@@ -181,18 +184,7 @@
        if (mprev == NULL || mprev->m_next != md) {
                ipseclog((LOG_DEBUG, "ipcomp%d_output: md is not in chain\n",
                    afnumber));
-               switch (af) {
-#ifdef INET
-               case AF_INET:
-                       ipsecstat.out_inval++;
-                       break;
-#endif
-#ifdef INET6
-               case AF_INET6:
-                       ipsec6stat.out_inval++;
-                       break;
-#endif
-               }
+               stat->out_inval++;
                m_freem(m);
                m_freem(md0);
                m_freem(mcopy);



Home | Main Index | Thread Index | Old Index