Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec dedup again



details:   https://anonhg.NetBSD.org/src/rev/04877d2d533f
branches:  trunk
changeset: 829860:04877d2d533f
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Feb 15 10:21:39 2018 +0000

description:
dedup again

diffstat:

 sys/netipsec/xform_ipip.c |  21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)

diffs (54 lines):

diff -r be83fd9ac743 -r 04877d2d533f sys/netipsec/xform_ipip.c
--- a/sys/netipsec/xform_ipip.c Thu Feb 15 10:09:53 2018 +0000
+++ b/sys/netipsec/xform_ipip.c Thu Feb 15 10:21:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_ipip.c,v 1.60 2018/02/15 10:09:53 maxv Exp $     */
+/*     $NetBSD: xform_ipip.c,v 1.61 2018/02/15 10:21:39 maxv Exp $     */
 /*     $FreeBSD: src/sys/netipsec/xform_ipip.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $ */
 /*     $OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */
 
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.60 2018/02/15 10:09:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.61 2018/02/15 10:21:39 maxv Exp $");
 
 /*
  * IP-inside-IP processing
@@ -216,11 +216,13 @@
 #ifdef INET
        case 4:
                hlen = sizeof(struct ip);
+               pktq = ip_pktq;
                break;
 #endif
 #ifdef INET6
        case 6:
                hlen = sizeof(struct ip6_hdr);
+               pktq = ip6_pktq;
                break;
 #endif
        default:
@@ -328,21 +330,6 @@
         * untrusted packets.
         */
 
-       switch (v >> 4) {
-#ifdef INET
-       case 4:
-               pktq = ip_pktq;
-               break;
-#endif
-#ifdef INET6
-       case 6:
-               pktq = ip6_pktq;
-               break;
-#endif
-       default:
-               panic("%s: should never reach here", __func__);
-       }
-
        int s = splnet();
        if (__predict_false(!pktq_enqueue(pktq, m, 0))) {
                IPIP_STATINC(IPIP_STAT_QFULL);



Home | Main Index | Thread Index | Old Index