eliminate variable argument in encapsw

This commit is contained in:
knakahara 2016-01-26 06:00:10 +00:00
parent b546d5277b
commit 51f4870974
6 changed files with 17 additions and 36 deletions

View File

@ -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 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf *m)
}
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);

View File

@ -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 *);

View File

@ -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 @@ struct encapsw {
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;

View File

@ -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 @@ extern int rsvp_on;
#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 @@ encap_send(struct ip *ip, struct vif *vifp, struct mbuf *m)
* 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);

View File

@ -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 @@ struct cryptoini;
/* 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);

View File

@ -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 @@ ip4_input6(struct mbuf **m, int *offp, int proto)
* 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 @@ ip4_input(struct mbuf *m, ...)
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 */