Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/51ef8718f797
branches:  netbsd-8
changeset: 851218:51ef8718f797
user:      snj <snj%NetBSD.org@localhost>
date:      Sun Dec 10 09:41:31 2017 +0000

description:
Pull up following revision(s) (requested by knakahara in ticket #419):
        sys/net/if_stf.c: revision 1.103
        sys/net/if_stf.h: revision 1.8
        sys/netinet/in_gif.c: revision 1.89
        sys/netinet/in_gif.h: revision 1.17
        sys/netinet/in_l2tp.c: revision 1.4
        sys/netinet/ip_encap.c: revision 1.66
        sys/netinet/ip_encap.h: revision 1.23
        sys/netinet/ip_mroute.c: revision 1.148
        sys/netinet6/in6_gif.c: revision 1.87
        sys/netinet6/in6_gif.h: revision 1.16
        sys/netinet6/in6_l2tp.c: revision 1.7
        sys/netipsec/xform.h: revision 1.13
        sys/netipsec/xform_ipip.c: revision 1.55
Add argument to encapsw->pr_input() instead of m_tag.

diffstat:

 sys/net/if_stf.c          |  14 +++++++-------
 sys/net/if_stf.h          |   4 ++--
 sys/netinet/in_gif.c      |  15 +++++++--------
 sys/netinet/in_gif.h      |   4 ++--
 sys/netinet/in_l2tp.c     |   8 ++++----
 sys/netinet/ip_encap.c    |  39 +++++----------------------------------
 sys/netinet/ip_encap.h    |   7 +++----
 sys/netinet/ip_mroute.c   |  17 +++++++++--------
 sys/netinet6/in6_gif.c    |  15 +++++++--------
 sys/netinet6/in6_gif.h    |   4 ++--
 sys/netinet6/in6_l2tp.c   |   8 ++++----
 sys/netipsec/xform.h      |   6 +++---
 sys/netipsec/xform_ipip.c |   8 ++++----
 13 files changed, 59 insertions(+), 90 deletions(-)

diffs (truncated from 478 to 300 lines):

diff -r 6dc301accc2f -r 51ef8718f797 sys/net/if_stf.c
--- a/sys/net/if_stf.c  Sun Dec 10 09:36:36 2017 +0000
+++ b/sys/net/if_stf.c  Sun Dec 10 09:41:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_stf.c,v 1.101 2016/12/12 03:55:57 ozaki-r Exp $     */
+/*     $NetBSD: if_stf.c,v 1.101.8.1 2017/12/10 09:41:31 snj Exp $     */
 /*     $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */
 
 /*
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.101 2016/12/12 03:55:57 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.101.8.1 2017/12/10 09:41:31 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -582,16 +582,18 @@
 }
 
 void
-in_stf_input(struct mbuf *m, int off, int proto)
+in_stf_input(struct mbuf *m, int off, int proto, void *eparg)
 {
        int s;
-       struct stf_softc *sc;
+       struct stf_softc *sc = eparg;
        struct ip *ip;
        struct ip6_hdr *ip6;
        uint8_t otos, itos;
        struct ifnet *ifp;
        size_t pktlen;
 
+       KASSERT(sc != NULL);
+
        if (proto != IPPROTO_IPV6) {
                m_freem(m);
                return;
@@ -599,9 +601,7 @@
 
        ip = mtod(m, struct ip *);
 
-       sc = (struct stf_softc *)encap_getarg(m);
-
-       if (sc == NULL || (sc->sc_if.if_flags & IFF_UP) == 0) {
+       if ((sc->sc_if.if_flags & IFF_UP) == 0) {
                m_freem(m);
                return;
        }
diff -r 6dc301accc2f -r 51ef8718f797 sys/net/if_stf.h
--- a/sys/net/if_stf.h  Sun Dec 10 09:36:36 2017 +0000
+++ b/sys/net/if_stf.h  Sun Dec 10 09:41:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_stf.h,v 1.7 2016/08/18 11:38:58 knakahara Exp $     */
+/*     $NetBSD: if_stf.h,v 1.7.8.1 2017/12/10 09:41:31 snj Exp $       */
 /*     $KAME: if_stf.h,v 1.3 2000/03/25 07:23:33 sumikawa Exp $        */
 
 /*
@@ -39,6 +39,6 @@
 #define        STF_MTU_MIN     (1280)  /* Minimum MTU */
 #define        STF_MTU_MAX     (8192)  /* Maximum MTU */
 
-void   in_stf_input(struct mbuf *, int, int);
+void   in_stf_input(struct mbuf *, int, int, void *);
 
 #endif /* !_NET_IF_STF_H_ */
diff -r 6dc301accc2f -r 51ef8718f797 sys/netinet/in_gif.c
--- a/sys/netinet/in_gif.c      Sun Dec 10 09:36:36 2017 +0000
+++ b/sys/netinet/in_gif.c      Sun Dec 10 09:41:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_gif.c,v 1.87.8.1 2017/10/24 08:47:24 snj Exp $      */
+/*     $NetBSD: in_gif.c,v 1.87.8.2 2017/12/10 09:41:31 snj Exp $      */
 /*     $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.87.8.1 2017/10/24 08:47:24 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.87.8.2 2017/12/10 09:41:31 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -195,19 +195,18 @@
 }
 
 void
-in_gif_input(struct mbuf *m, int off, int proto)
+in_gif_input(struct mbuf *m, int off, int proto, void *eparg)
 {
-       struct ifnet *gifp = NULL;
+       struct ifnet *gifp = eparg;
        const struct ip *ip;
        int af;
        u_int8_t otos;
 
+       KASSERT(gifp != NULL);
+
        ip = mtod(m, const struct ip *);
 
-       gifp = (struct ifnet *)encap_getarg(m);
-
-       if (gifp == NULL || (gifp->if_flags & (IFF_UP|IFF_RUNNING))
-               != (IFF_UP|IFF_RUNNING)) {
+       if ((gifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) {
                m_freem(m);
                ip_statinc(IP_STAT_NOGIF);
                return;
diff -r 6dc301accc2f -r 51ef8718f797 sys/netinet/in_gif.h
--- a/sys/netinet/in_gif.h      Sun Dec 10 09:36:36 2017 +0000
+++ b/sys/netinet/in_gif.h      Sun Dec 10 09:41:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_gif.h,v 1.16 2016/07/04 04:22:47 knakahara Exp $    */
+/*     $NetBSD: in_gif.h,v 1.16.10.1 2017/12/10 09:41:31 snj Exp $     */
 /*     $KAME: in_gif.h,v 1.6 2001/07/25 00:55:48 itojun Exp $  */
 
 /*
@@ -38,7 +38,7 @@
 extern int ip_gif_ttl;
 
 struct gif_softc;
-void in_gif_input(struct mbuf *, int, int);
+void in_gif_input(struct mbuf *, int, int, void *);
 int in_gif_output(struct ifnet *, int, struct mbuf *);
 #ifdef GIF_ENCAPCHECK
 int gif_encapcheck4(struct mbuf *, int, int, void *);
diff -r 6dc301accc2f -r 51ef8718f797 sys/netinet/in_l2tp.c
--- a/sys/netinet/in_l2tp.c     Sun Dec 10 09:36:36 2017 +0000
+++ b/sys/netinet/in_l2tp.c     Sun Dec 10 09:41:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_l2tp.c,v 1.2.8.1 2017/07/12 13:42:11 martin Exp $   */
+/*     $NetBSD: in_l2tp.c,v 1.2.8.2 2017/12/10 09:41:31 snj Exp $      */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.2.8.1 2017/07/12 13:42:11 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.2.8.2 2017/12/10 09:41:31 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_l2tp.h"
@@ -72,7 +72,7 @@
 
 int ip_l2tp_ttl = L2TP_TTL;
 
-static void in_l2tp_input(struct mbuf *, int, int);
+static void in_l2tp_input(struct mbuf *, int, int, void *);
 
 static const struct encapsw in_l2tp_encapsw = {
        .encapsw4 = {
@@ -250,7 +250,7 @@
 }
 
 static void
-in_l2tp_input(struct mbuf *m, int off, int proto)
+in_l2tp_input(struct mbuf *m, int off, int proto, void *eparg __unused)
 {
        struct ifnet *l2tpp = NULL;
        struct l2tp_softc *sc;
diff -r 6dc301accc2f -r 51ef8718f797 sys/netinet/ip_encap.c
--- a/sys/netinet/ip_encap.c    Sun Dec 10 09:36:36 2017 +0000
+++ b/sys/netinet/ip_encap.c    Sun Dec 10 09:41:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_encap.c,v 1.65 2017/06/01 02:45:14 chs Exp $        */
+/*     $NetBSD: ip_encap.c,v 1.65.2.1 2017/12/10 09:41:31 snj Exp $    */
 /*     $KAME: ip_encap.c,v 1.73 2001/10/02 08:30:58 itojun Exp $       */
 
 /*
@@ -68,7 +68,7 @@
 #define USE_RADIX
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.65 2017/06/01 02:45:14 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.65.2.1 2017/12/10 09:41:31 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mrouting.h"
@@ -135,7 +135,6 @@
 static int mask_match(const struct encaptab *, const struct sockaddr *,
                const struct sockaddr *);
 #endif
-static void encap_fillarg(struct mbuf *, const struct encaptab *);
 
 /*
  * In encap[46]_lookup(), ep->func can sleep(e.g. rtalloc1) while walking
@@ -363,8 +362,7 @@
                /* found a match, "match" has the best one */
                esw = match->esw;
                if (esw && esw->encapsw4.pr_input) {
-                       encap_fillarg(m, match);
-                       (*esw->encapsw4.pr_input)(m, off, proto);
+                       (*esw->encapsw4.pr_input)(m, off, proto, match->arg);
                        psref_release(&match_psref, &match->psref,
                            encaptab.elem_class);
                } else {
@@ -506,8 +504,8 @@
                esw = match->esw;
                if (esw && esw->encapsw6.pr_input) {
                        int ret;
-                       encap_fillarg(m, match);
-                       ret = (*esw->encapsw6.pr_input)(mp, offp, proto);
+                       ret = (*esw->encapsw6.pr_input)(mp, offp, proto,
+                           match->arg);
                        psref_release(&match_psref, &match->psref,
                            encaptab.elem_class);
                        return ret;
@@ -1064,33 +1062,6 @@
 }
 #endif
 
-static void
-encap_fillarg(struct mbuf *m, const struct encaptab *ep)
-{
-       struct m_tag *mtag;
-
-       mtag = m_tag_get(PACKET_TAG_ENCAP, sizeof(void *), M_NOWAIT);
-       if (mtag) {
-               *(void **)(mtag + 1) = ep->arg;
-               m_tag_prepend(m, mtag);
-       }
-}
-
-void *
-encap_getarg(struct mbuf *m)
-{
-       void *p;
-       struct m_tag *mtag;
-
-       p = NULL;
-       mtag = m_tag_find(m, PACKET_TAG_ENCAP, NULL);
-       if (mtag != NULL) {
-               p = *(void **)(mtag + 1);
-               m_tag_delete(m, mtag);
-       }
-       return p;
-}
-
 int
 encap_lock_enter(void)
 {
diff -r 6dc301accc2f -r 51ef8718f797 sys/netinet/ip_encap.h
--- a/sys/netinet/ip_encap.h    Sun Dec 10 09:36:36 2017 +0000
+++ b/sys/netinet/ip_encap.h    Sun Dec 10 09:41:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_encap.h,v 1.22 2016/07/04 04:35:09 knakahara Exp $  */
+/*     $NetBSD: ip_encap.h,v 1.22.10.1 2017/12/10 09:41:31 snj Exp $   */
 /*     $KAME: ip_encap.h,v 1.7 2000/03/25 07:23:37 sumikawa Exp $      */
 
 /*
@@ -46,13 +46,13 @@
        union {
                struct encapsw4 {
                        void    (*pr_input)     /* input to protocol (from below) */
-                               (struct mbuf *, int, int);
+                               (struct mbuf *, int, int, void *);
                        void    *(*pr_ctlinput)         /* control input (from below) */
                                (int, const struct sockaddr *, void *, void *);
                } _encapsw4;
                struct encapsw6 {
                        int     (*pr_input)     /* input to protocol (from below) */
-                               (struct mbuf **, int *, int);
+                               (struct mbuf **, int *, int, void *);
                        void    *(*pr_ctlinput)         /* control input (from below) */
                                (int, const struct sockaddr *, void *, void *);
                } _encapsw6;
@@ -110,7 +110,6 @@
        const struct encapsw *, void *);
 void   *encap6_ctlinput(int, const struct sockaddr *, void *);
 int    encap_detach(const struct encaptab *);
-void   *encap_getarg(struct mbuf *);
 
 int    encap_lock_enter(void);
 void   encap_lock_exit(void);
diff -r 6dc301accc2f -r 51ef8718f797 sys/netinet/ip_mroute.c
--- a/sys/netinet/ip_mroute.c   Sun Dec 10 09:36:36 2017 +0000
+++ b/sys/netinet/ip_mroute.c   Sun Dec 10 09:41:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_mroute.c,v 1.146 2017/01/24 07:09:24 ozaki-r Exp $  */
+/*     $NetBSD: ip_mroute.c,v 1.146.6.1 2017/12/10 09:41:31 snj Exp $  */
 
 /*
  * Copyright (c) 1992, 1993
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.146 2017/01/24 07:09:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.146.6.1 2017/12/10 09:41:31 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -188,7 +188,7 @@
 #endif /* RSVP_ISI */
 
 /* vif attachment using sys/netinet/ip_encap.c */



Home | Main Index | Thread Index | Old Index