Source-Changes-HG archive

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

[src/trunk]: src/sys eliminate variable argument in encapsw



details:   https://anonhg.NetBSD.org/src/rev/8d9f03e7d719
branches:  trunk
changeset: 343241:8d9f03e7d719
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Tue Jan 26 06:00:10 2016 +0000

description:
eliminate variable argument in encapsw

diffstat:

 sys/netinet/in_gif.c      |  13 +++----------
 sys/netinet/in_gif.h      |   4 ++--
 sys/netinet/ip_encap.h    |   4 ++--
 sys/netinet/ip_mroute.c   |  15 ++++-----------
 sys/netipsec/xform.h      |   4 ++--
 sys/netipsec/xform_ipip.c |  13 ++++---------
 6 files changed, 17 insertions(+), 36 deletions(-)

diffs (183 lines):

diff -r 8cc3e6466a03 -r 8d9f03e7d719 sys/netinet/in_gif.c
--- a/sys/netinet/in_gif.c      Tue Jan 26 05:58:05 2016 +0000
+++ b/sys/netinet/in_gif.c      Tue Jan 26 06:00:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_gif.c,v 1.74 2016/01/26 05:58:05 knakahara Exp $    */
+/*     $NetBSD: in_gif.c,v 1.75 2016/01/26 06:00:10 knakahara 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.74 2016/01/26 05:58:05 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.75 2016/01/26 06:00:10 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -193,20 +193,13 @@
 }
 
 void
-in_gif_input(struct mbuf *m, ...)
+in_gif_input(struct mbuf *m, int off, int proto)
 {
-       int off, proto;
        struct ifnet *gifp = NULL;
        const struct ip *ip;
-       va_list ap;
        int af;
        u_int8_t otos;
 
-       va_start(ap, m);
-       off = va_arg(ap, int);
-       proto = va_arg(ap, int);
-       va_end(ap);
-
        ip = mtod(m, const struct ip *);
 
        gifp = (struct ifnet *)encap_getarg(m);
diff -r 8cc3e6466a03 -r 8d9f03e7d719 sys/netinet/in_gif.h
--- a/sys/netinet/in_gif.h      Tue Jan 26 05:58:05 2016 +0000
+++ b/sys/netinet/in_gif.h      Tue Jan 26 06:00:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_gif.h,v 1.14 2006/11/23 04:07:07 rpaulo Exp $       */
+/*     $NetBSD: in_gif.h,v 1.15 2016/01/26 06:00:10 knakahara 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 *, ...);
+void in_gif_input(struct mbuf *, int, int);
 int in_gif_output(struct ifnet *, int, struct mbuf *);
 #ifdef GIF_ENCAPCHECK
 int gif_encapcheck4(struct mbuf *, int, int, void *);
diff -r 8cc3e6466a03 -r 8d9f03e7d719 sys/netinet/ip_encap.h
--- a/sys/netinet/ip_encap.h    Tue Jan 26 05:58:05 2016 +0000
+++ b/sys/netinet/ip_encap.h    Tue Jan 26 06:00:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_encap.h,v 1.16 2016/01/26 05:58:05 knakahara Exp $  */
+/*     $NetBSD: ip_encap.h,v 1.17 2016/01/26 06:00:10 knakahara Exp $  */
 /*     $KAME: ip_encap.h,v 1.7 2000/03/25 07:23:37 sumikawa Exp $      */
 
 /*
@@ -43,7 +43,7 @@
        union {
                struct encapsw4 {
                        void    (*pr_input)     /* input to protocol (from below) */
-                               (struct mbuf *, ...);
+                               (struct mbuf *, int, int);
                        void    *(*pr_ctlinput) /* control input (from below) */
                                (int, const struct sockaddr *, void *);
                } _encapsw4;
diff -r 8cc3e6466a03 -r 8d9f03e7d719 sys/netinet/ip_mroute.c
--- a/sys/netinet/ip_mroute.c   Tue Jan 26 05:58:05 2016 +0000
+++ b/sys/netinet/ip_mroute.c   Tue Jan 26 06:00:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_mroute.c,v 1.137 2016/01/26 05:58:05 knakahara Exp $        */
+/*     $NetBSD: ip_mroute.c,v 1.138 2016/01/26 06:00:10 knakahara Exp $        */
 
 /*
  * Copyright (c) 1992, 1993
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.137 2016/01/26 05:58:05 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.138 2016/01/26 06:00:10 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -190,7 +190,7 @@
 #endif /* RSVP_ISI */
 
 /* vif attachment using sys/netinet/ip_encap.c */
-static void vif_input(struct mbuf *, ...);
+static void vif_input(struct mbuf *, int, int);
 static int vif_encapcheck(struct mbuf *, int, int, void *);
 
 static const struct encapsw vif_encapsw = {
@@ -1870,17 +1870,10 @@
  * De-encapsulate a packet and feed it back through ip input.
  */
 static void
-vif_input(struct mbuf *m, ...)
+vif_input(struct mbuf *m, int off, int proto)
 {
-       int off, proto;
-       va_list ap;
        struct vif *vifp;
 
-       va_start(ap, m);
-       off = va_arg(ap, int);
-       proto = va_arg(ap, int);
-       va_end(ap);
-
        vifp = (struct vif *)encap_getarg(m);
        if (!vifp || proto != ENCAP_PROTO) {
                m_freem(m);
diff -r 8cc3e6466a03 -r 8d9f03e7d719 sys/netipsec/xform.h
--- a/sys/netipsec/xform.h      Tue Jan 26 05:58:05 2016 +0000
+++ b/sys/netipsec/xform.h      Tue Jan 26 06:00:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform.h,v 1.7 2011/02/25 20:13:10 drochner Exp $       */
+/*     $NetBSD: xform.h,v 1.8 2016/01/26 06:00:10 knakahara Exp $      */
 /*     $FreeBSD: src/sys/netipsec/xform.h,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $      */
 /*     $OpenBSD: ip_ipsp.h,v 1.119 2002/03/14 01:27:11 millert Exp $   */
 /*
@@ -105,7 +105,7 @@
 
 /* XF_IP4 */
 extern int ip4_input6(struct mbuf **m, int *offp, int proto);
-extern void ip4_input(struct mbuf *m, ...);
+extern void ip4_input(struct mbuf *m, int, int);
 extern int ipip_output(struct mbuf *, struct ipsecrequest *,
                        struct mbuf **, int, int);
 
diff -r 8cc3e6466a03 -r 8d9f03e7d719 sys/netipsec/xform_ipip.c
--- a/sys/netipsec/xform_ipip.c Tue Jan 26 05:58:05 2016 +0000
+++ b/sys/netipsec/xform_ipip.c Tue Jan 26 06:00:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_ipip.c,v 1.36 2016/01/26 05:58:06 knakahara Exp $        */
+/*     $NetBSD: xform_ipip.c,v 1.37 2016/01/26 06:00:10 knakahara 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.36 2016/01/26 05:58:06 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.37 2016/01/26 06:00:10 knakahara Exp $");
 
 /*
  * IP-inside-IP processing
@@ -159,10 +159,8 @@
  * Really only a wrapper for ipip_input(), for use with IPv4.
  */
 void
-ip4_input(struct mbuf *m, ...)
+ip4_input(struct mbuf *m, int off, int proto)
 {
-       va_list ap;
-       int iphlen;
 
 #if 0
        /* If we do not accept IP-in-IP explicitly, drop.  */
@@ -173,11 +171,8 @@
                return;
        }
 #endif
-       va_start(ap, m);
-       iphlen = va_arg(ap, int);
-       va_end(ap);
 
-       _ipip_input(m, iphlen, NULL);
+       _ipip_input(m, off, NULL);
 }
 #endif /* INET */
 



Home | Main Index | Thread Index | Old Index