summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-01-25 17:34:32 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-01-25 17:34:32 +0000
commit759669db69ca341876a0af1e0abc98af49c4a3d8 (patch)
treebe8139d53bbf33aefbe757800ac18ac4137c34b6
parentfb34f730610f368d97d9636e7f5714656e624c8c (diff)
Since raw_input() and route_input() are gone from pr_input, we can
make the variable parameters of the protocol input functions fixed. Also add the proto to make it similar to IPv6. OK mpi@ guenther@ millert@
-rw-r--r--sys/net/if_etherip.c12
-rw-r--r--sys/net/if_etherip.h2
-rw-r--r--sys/net/if_gif.c12
-rw-r--r--sys/net/if_gif.h4
-rw-r--r--sys/net/if_pfsync.c4
-rw-r--r--sys/net/if_pfsync.h4
-rw-r--r--sys/netinet/igmp.c18
-rw-r--r--sys/netinet/igmp_var.h4
-rw-r--r--sys/netinet/ip_carp.c10
-rw-r--r--sys/netinet/ip_carp.h4
-rw-r--r--sys/netinet/ip_divert.c4
-rw-r--r--sys/netinet/ip_divert.h4
-rw-r--r--sys/netinet/ip_ether.c10
-rw-r--r--sys/netinet/ip_ether.h4
-rw-r--r--sys/netinet/ip_gre.c29
-rw-r--r--sys/netinet/ip_gre.h6
-rw-r--r--sys/netinet/ip_icmp.c18
-rw-r--r--sys/netinet/ip_icmp.h4
-rw-r--r--sys/netinet/ip_input.c4
-rw-r--r--sys/netinet/ip_ipip.c12
-rw-r--r--sys/netinet/ip_ipsp.h12
-rw-r--r--sys/netinet/ip_var.h4
-rw-r--r--sys/netinet/ipsec_input.c28
-rw-r--r--sys/netinet/raw_ip.c4
-rw-r--r--sys/netinet/tcp_input.c10
-rw-r--r--sys/netinet/tcp_var.h4
-rw-r--r--sys/netinet/udp_usrreq.c11
-rw-r--r--sys/netinet/udp_var.h4
-rw-r--r--sys/sys/protosw.h4
29 files changed, 83 insertions, 167 deletions
diff --git a/sys/net/if_etherip.c b/sys/net/if_etherip.c
index c803a247bb8..6268b3d6541 100644
--- a/sys/net/if_etherip.c
+++ b/sys/net/if_etherip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_etherip.c,v 1.12 2017/01/23 11:37:29 mpi Exp $ */
+/* $OpenBSD: if_etherip.c,v 1.13 2017/01/25 17:34:31 bluhm Exp $ */
/*
* Copyright (c) 2015 Kazuya GODA <goda@openbsd.org>
*
@@ -405,7 +405,7 @@ ip_etherip_output(struct ifnet *ifp, struct mbuf *m)
}
void
-ip_etherip_input(struct mbuf *m, ...)
+ip_etherip_input(struct mbuf *m, int off, int proto)
{
struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct etherip_softc *sc;
@@ -413,12 +413,6 @@ ip_etherip_input(struct mbuf *m, ...)
struct etherip_header *eip;
struct sockaddr_in *src, *dst;
struct ifnet *ifp = NULL;
- int off;
- va_list ap;
-
- va_start(ap, m);
- off = va_arg(ap, int);
- va_end(ap);
ip = mtod(m, struct ip *);
@@ -458,7 +452,7 @@ ip_etherip_input(struct mbuf *m, ...)
* This is tricky but the path will be removed soon when
* implementation of etherip is removed from gif(4).
*/
- etherip_input(m, off);
+ etherip_input(m, off, proto);
#else
etheripstat.etherip_noifdrops++;
m_freem(m);
diff --git a/sys/net/if_etherip.h b/sys/net/if_etherip.h
index 3a5cfdb4554..11f17336463 100644
--- a/sys/net/if_etherip.h
+++ b/sys/net/if_etherip.h
@@ -73,7 +73,7 @@ struct etherip_header {
int ip_etherip_sysctl(int *, uint, void *, size_t *, void *, size_t);
int ip_etherip_output(struct ifnet *, struct mbuf *);
-void ip_etherip_input(struct mbuf *, ...);
+void ip_etherip_input(struct mbuf *, int, int);
#ifdef INET6
int ip6_etherip_output(struct ifnet *, struct mbuf *);
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 02910c041f0..4befe57b117 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gif.c,v 1.89 2017/01/23 11:37:29 mpi Exp $ */
+/* $OpenBSD: if_gif.c,v 1.90 2017/01/25 17:34:31 bluhm Exp $ */
/* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */
/*
@@ -716,17 +716,11 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf **m0)
}
void
-in_gif_input(struct mbuf *m, ...)
+in_gif_input(struct mbuf *m, int off, int proto)
{
- int off;
struct gif_softc *sc;
struct ifnet *gifp = NULL;
struct ip *ip;
- va_list ap;
-
- va_start(ap, m);
- off = va_arg(ap, int);
- va_end(ap);
/* IP-in-IP header is caused by tunnel mode, so skip gif lookup */
if (m->m_flags & M_TUNNEL) {
@@ -767,7 +761,7 @@ in_gif_input(struct mbuf *m, ...)
}
inject:
- ip4_input(m, off); /* No GIF interface was configured */
+ ip4_input(m, off, proto); /* No GIF interface was configured */
return;
}
diff --git a/sys/net/if_gif.h b/sys/net/if_gif.h
index 8fe78602d01..182fd84fd77 100644
--- a/sys/net/if_gif.h
+++ b/sys/net/if_gif.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gif.h,v 1.14 2015/09/28 08:32:05 mpi Exp $ */
+/* $OpenBSD: if_gif.h,v 1.15 2017/01/25 17:34:31 bluhm Exp $ */
/* $KAME: if_gif.h,v 1.17 2000/09/11 11:36:41 sumikawa Exp $ */
/*
@@ -49,7 +49,7 @@ extern LIST_HEAD(gif_softc_head, gif_softc) gif_softc_list;
int gif_encap(struct ifnet *, struct mbuf **, sa_family_t);
-void in_gif_input(struct mbuf *, ...);
+void in_gif_input(struct mbuf *, int, int);
int in6_gif_input(struct mbuf **, int *, int);
#endif /* _NET_IF_GIF_H_ */
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 54cbef445c1..7ab3e1f1eb7 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.242 2017/01/23 11:37:29 mpi Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.243 2017/01/25 17:34:31 bluhm Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -635,7 +635,7 @@ pfsync_state_import(struct pfsync_state *sp, int flags)
}
void
-pfsync_input(struct mbuf *m, ...)
+pfsync_input(struct mbuf *m, int iphlen, int proto)
{
struct pfsync_softc *sc = pfsyncif;
struct ip *ip = mtod(m, struct ip *);
diff --git a/sys/net/if_pfsync.h b/sys/net/if_pfsync.h
index 1d4b1049af9..2c31bc6c0ee 100644
--- a/sys/net/if_pfsync.h
+++ b/sys/net/if_pfsync.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.h,v 1.49 2017/01/20 05:03:48 claudio Exp $ */
+/* $OpenBSD: if_pfsync.h,v 1.50 2017/01/25 17:34:31 bluhm Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -286,7 +286,7 @@ struct pfsyncreq {
#define PFSYNC_S_DEFER 0xfe
#define PFSYNC_S_NONE 0xff
-void pfsync_input(struct mbuf *, ...);
+void pfsync_input(struct mbuf *, int, int);
int pfsync_sysctl(int *, u_int, void *, size_t *,
void *, size_t);
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index c59d03038c1..5e4d2a26bd3 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: igmp.c,v 1.60 2017/01/04 04:56:24 dlg Exp $ */
+/* $OpenBSD: igmp.c,v 1.61 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */
/*
@@ -107,7 +107,7 @@ void igmp_checktimer(struct ifnet *);
void igmp_sendpkt(struct ifnet *, struct in_multi *, int, in_addr_t);
int rti_fill(struct in_multi *);
struct router_info * rti_find(struct ifnet *);
-void igmp_input_if(struct ifnet *, struct mbuf *, int);
+void igmp_input_if(struct ifnet *, struct mbuf *, int, int);
int igmp_sysctl_igmpstat(void *, size_t *, void *);
void
@@ -209,15 +209,9 @@ rti_delete(struct ifnet *ifp)
}
void
-igmp_input(struct mbuf *m, ...)
+igmp_input(struct mbuf *m, int iphlen, int proto)
{
- int iphlen;
struct ifnet *ifp;
- va_list ap;
-
- va_start(ap, m);
- iphlen = va_arg(ap, int);
- va_end(ap);
igmpstat_inc(igps_rcv_total);
@@ -227,12 +221,12 @@ igmp_input(struct mbuf *m, ...)
return;
}
- igmp_input_if(ifp, m, iphlen);
+ igmp_input_if(ifp, m, iphlen, proto);
if_put(ifp);
}
void
-igmp_input_if(struct ifnet *ifp, struct mbuf *m, int iphlen)
+igmp_input_if(struct ifnet *ifp, struct mbuf *m, int iphlen, int proto)
{
struct ip *ip = mtod(m, struct ip *);
struct igmp *igmp;
@@ -493,7 +487,7 @@ igmp_input_if(struct ifnet *ifp, struct mbuf *m, int iphlen)
* Pass all valid IGMP packets up to any process(es) listening
* on a raw IGMP socket.
*/
- rip_input(m);
+ rip_input(m, iphlen, proto);
}
void
diff --git a/sys/netinet/igmp_var.h b/sys/netinet/igmp_var.h
index 091022c8110..33e32b180b9 100644
--- a/sys/netinet/igmp_var.h
+++ b/sys/netinet/igmp_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: igmp_var.h,v 1.10 2017/01/04 04:56:24 dlg Exp $ */
+/* $OpenBSD: igmp_var.h,v 1.11 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: igmp_var.h,v 1.9 1996/02/13 23:41:31 christos Exp $ */
/*
@@ -110,7 +110,7 @@ igmpstat_inc(enum igmpstat_counters c)
#define IGMP_RANDOM_DELAY(X) (arc4random_uniform(X) + 1)
void igmp_init(void);
-void igmp_input(struct mbuf *, ...);
+void igmp_input(struct mbuf *, int, int);
void igmp_joingroup(struct in_multi *);
void igmp_leavegroup(struct in_multi *);
void igmp_fasttimo(void);
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 6bf9a55dcc7..dc28054a35a 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.299 2017/01/23 11:37:29 mpi Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.300 2017/01/25 17:34:31 bluhm Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -412,15 +412,9 @@ carp_hmac_verify(struct carp_vhost_entry *vhe, u_int32_t counter[2],
}
void
-carp_proto_input(struct mbuf *m, ...)
+carp_proto_input(struct mbuf *m, int hlen, int proto)
{
struct ifnet *ifp;
- int hlen;
- va_list ap;
-
- va_start(ap, m);
- hlen = va_arg(ap, int);
- va_end(ap);
ifp = if_get(m->m_pkthdr.ph_ifidx);
if (ifp == NULL) {
diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h
index 1110e444078..8ec1979135a 100644
--- a/sys/netinet/ip_carp.h
+++ b/sys/netinet/ip_carp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.h,v 1.38 2016/06/06 07:01:37 mpi Exp $ */
+/* $OpenBSD: ip_carp.h,v 1.39 2017/01/25 17:34:31 bluhm Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -163,7 +163,7 @@ struct carpreq {
#ifdef _KERNEL
void carp_ifdetach (struct ifnet *);
-void carp_proto_input (struct mbuf *, ...);
+void carp_proto_input (struct mbuf *, int, int);
void carp_carpdev_state(void *);
void carp_group_demote_adj(struct ifnet *, int, char *);
int carp6_proto_input(struct mbuf **, int *, int);
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 7324fe5374d..1bdf3bf75fa 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_divert.c,v 1.41 2016/12/19 08:36:49 mpi Exp $ */
+/* $OpenBSD: ip_divert.c,v 1.42 2017/01/25 17:34:31 bluhm Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -72,7 +72,7 @@ divert_init(void)
}
void
-divert_input(struct mbuf *m, ...)
+divert_input(struct mbuf *m, int iphlen, int proto)
{
m_freem(m);
}
diff --git a/sys/netinet/ip_divert.h b/sys/netinet/ip_divert.h
index 7294a48aaf5..57a0fd5940c 100644
--- a/sys/netinet/ip_divert.h
+++ b/sys/netinet/ip_divert.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_divert.h,v 1.6 2014/07/10 03:17:59 lteo Exp $ */
+/* $OpenBSD: ip_divert.h,v 1.7 2017/01/25 17:34:31 bluhm Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -54,7 +54,7 @@ extern struct inpcbtable divbtable;
extern struct divstat divstat;
void divert_init(void);
-void divert_input(struct mbuf *, ...);
+void divert_input(struct mbuf *, int, int);
int divert_packet(struct mbuf *, int, u_int16_t);
int divert_sysctl(int *, u_int, void *, size_t *, void *, size_t);
int divert_usrreq(struct socket *,
diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c
index 08363ae55fa..7ccfa42575b 100644
--- a/sys/netinet/ip_ether.c
+++ b/sys/netinet/ip_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ether.c,v 1.81 2016/09/24 14:51:37 naddy Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.82 2017/01/25 17:34:31 bluhm Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
*
@@ -89,18 +89,12 @@ struct etheripstat etheripstat;
* Only a wrapper for the IPv4 case.
*/
void
-etherip_input(struct mbuf *m, ...)
+etherip_input(struct mbuf *m, int iphlen, int proto)
{
struct ip *ip;
- va_list ap;
- int iphlen;
ip = mtod(m, struct ip *);
- va_start(ap, m);
- iphlen = va_arg(ap, int);
- va_end(ap);
-
switch (ip->ip_p) {
#if NBRIDGE > 0
case IPPROTO_ETHERIP:
diff --git a/sys/netinet/ip_ether.h b/sys/netinet/ip_ether.h
index d25b6254d68..4aa03c15f7c 100644
--- a/sys/netinet/ip_ether.h
+++ b/sys/netinet/ip_ether.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ether.h,v 1.18 2014/07/14 12:18:30 deraadt Exp $ */
+/* $OpenBSD: ip_ether.h,v 1.19 2017/01/25 17:34:31 bluhm Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@adk.gr)
*
@@ -72,7 +72,7 @@ struct etherip_header {
struct tdb;
int etherip_output(struct mbuf *, struct tdb *, struct mbuf **, int);
-void etherip_input(struct mbuf *, ...);
+void etherip_input(struct mbuf *, int, int);
#ifdef INET6
int etherip_input6(struct mbuf **, int *, int);
#endif
diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c
index 58dee961cfe..4f480767882 100644
--- a/sys/netinet/ip_gre.c
+++ b/sys/netinet/ip_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_gre.c,v 1.60 2017/01/03 10:52:21 mpi Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.61 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -78,7 +78,7 @@
#include <net/if_gre.h>
struct gre_softc *gre_lookup(struct mbuf *, u_int8_t);
-int gre_input2(struct mbuf *, int, u_char);
+int gre_input2(struct mbuf *, int, int);
/*
* Decapsulate.
@@ -90,7 +90,7 @@ int gre_input2(struct mbuf *, int, u_char);
*/
int
-gre_input2(struct mbuf *m, int hlen, u_char proto)
+gre_input2(struct mbuf *m, int hlen, int proto)
{
struct greip *gip;
struct niqueue *ifq;
@@ -216,14 +216,9 @@ gre_input2(struct mbuf *m, int hlen, u_char proto)
* IPPROTO_GRE and a local destination address).
*/
void
-gre_input(struct mbuf *m, ...)
+gre_input(struct mbuf *m, int hlen, int proto)
{
- int hlen, ret;
- va_list ap;
-
- va_start(ap, m);
- hlen = va_arg(ap, int);
- va_end(ap);
+ int ret;
if (!gre_allow) {
m_freem(m);
@@ -241,7 +236,7 @@ gre_input(struct mbuf *m, ...)
}
#endif
- ret = gre_input2(m, hlen, IPPROTO_GRE);
+ ret = gre_input2(m, hlen, proto);
/*
* ret == 0: packet not processed, but input from here
* means no matching tunnel that is up is found.
@@ -250,7 +245,7 @@ gre_input(struct mbuf *m, ...)
* but we're not set to accept them.
*/
if (!ret)
- rip_input(m, hlen, IPPROTO_GRE);
+ rip_input(m, hlen, proto);
}
/*
@@ -261,26 +256,20 @@ gre_input(struct mbuf *m, ...)
*/
void
-gre_mobile_input(struct mbuf *m, ...)
+gre_mobile_input(struct mbuf *m, int hlen, int proto)
{
struct ip *ip;
struct mobip_h *mip;
struct gre_softc *sc;
- int hlen;
- va_list ap;
u_char osrc = 0;
int msiz;
- va_start(ap, m);
- hlen = va_arg(ap, int);
- va_end(ap);
-
if (!ip_mobile_allow) {
m_freem(m);
return;
}
- if ((sc = gre_lookup(m, IPPROTO_MOBILE)) == NULL) {
+ if ((sc = gre_lookup(m, proto)) == NULL) {
/* No matching tunnel or tunnel is down. */
m_freem(m);
return;
diff --git a/sys/netinet/ip_gre.h b/sys/netinet/ip_gre.h
index e91845647a8..c4394519c25 100644
--- a/sys/netinet/ip_gre.h
+++ b/sys/netinet/ip_gre.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_gre.h,v 1.9 2010/01/12 23:33:24 yasuoka Exp $ */
+/* $OpenBSD: ip_gre.h,v 1.10 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: ip_gre.h,v 1.3 1998/10/07 23:33:02 thorpej Exp $ */
/*
@@ -64,8 +64,8 @@
}
#ifdef _KERNEL
-void gre_input(struct mbuf *, ...);
-void gre_mobile_input(struct mbuf *, ...);
+void gre_input(struct mbuf *, int, int);
+void gre_mobile_input(struct mbuf *, int, int);
int ipmobile_sysctl(int *, u_int, void *, size_t *, void *, size_t);
int gre_sysctl(int *, u_int, void *, size_t *, void *, size_t);
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 35db6be43ea..a312182becc 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.159 2016/12/20 18:33:43 bluhm Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.160 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -128,7 +128,7 @@ int *icmpctl_vars[ICMPCTL_MAXID] = ICMPCTL_VARS;
void icmp_mtudisc_timeout(struct rtentry *, struct rttimer *);
int icmp_ratelimit(const struct in_addr *, const int, const int);
void icmp_redirect_timeout(struct rtentry *, struct rttimer *);
-void icmp_input_if(struct ifnet *, struct mbuf *, int);
+void icmp_input_if(struct ifnet *, struct mbuf *, int, int);
void
icmp_init(void)
@@ -304,15 +304,9 @@ icmp_error(struct mbuf *n, int type, int code, u_int32_t dest, int destmtu)
* Process a received ICMP message.
*/
void
-icmp_input(struct mbuf *m, ...)
+icmp_input(struct mbuf *m, int hlen, int proto)
{
struct ifnet *ifp;
- int hlen;
- va_list ap;
-
- va_start(ap, m);
- hlen = va_arg(ap, int);
- va_end(ap);
ifp = if_get(m->m_pkthdr.ph_ifidx);
if (ifp == NULL) {
@@ -320,12 +314,12 @@ icmp_input(struct mbuf *m, ...)
return;
}
- icmp_input_if(ifp, m, hlen);
+ icmp_input_if(ifp, m, hlen, proto);
if_put(ifp);
}
void
-icmp_input_if(struct ifnet *ifp, struct mbuf *m, int hlen)
+icmp_input_if(struct ifnet *ifp, struct mbuf *m, int hlen, int proto)
{
struct icmp *icp;
struct ip *ip = mtod(m, struct ip *);
@@ -686,7 +680,7 @@ reflect:
}
raw:
- rip_input(m);
+ rip_input(m, hlen, proto);
return;
freeit:
diff --git a/sys/netinet/ip_icmp.h b/sys/netinet/ip_icmp.h
index fcee2b11d9b..54fed25106f 100644
--- a/sys/netinet/ip_icmp.h
+++ b/sys/netinet/ip_icmp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.h,v 1.27 2016/03/07 19:33:26 mmcc Exp $ */
+/* $OpenBSD: ip_icmp.h,v 1.28 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: ip_icmp.h,v 1.10 1996/02/13 23:42:28 christos Exp $ */
/*
@@ -232,7 +232,7 @@ struct icmp_ext_obj_hdr {
struct mbuf *
icmp_do_error(struct mbuf *, int, int, u_int32_t, int);
void icmp_error(struct mbuf *, int, int, u_int32_t, int);
-void icmp_input(struct mbuf *, ...);
+void icmp_input(struct mbuf *, int, int);
void icmp_init(void);
int icmp_reflect(struct mbuf *, struct mbuf **, struct in_ifaddr *);
void icmp_send(struct mbuf *, struct mbuf *);
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 5243e38b6b3..dbb9eed2566 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.291 2016/12/20 18:33:43 bluhm Exp $ */
+/* $OpenBSD: ip_input.c,v 1.292 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -584,7 +584,7 @@ found:
* Switch out to protocol's input routine.
*/
ipstat_inc(ips_delivered);
- (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen, NULL, 0);
+ (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen, ip->ip_p);
return;
bad:
m_freem(m);
diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c
index b5d4bf520ce..138e225ef8a 100644
--- a/sys/netinet/ip_ipip.c
+++ b/sys/netinet/ip_ipip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipip.c,v 1.69 2016/03/07 18:44:00 naddy Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.70 2017/01/25 17:34:31 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -110,11 +110,9 @@ ip4_input6(struct mbuf **mp, 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 iphlen, int proto)
{
struct ip *ip;
- va_list ap;
- int iphlen;
/* If we do not accept IP-in-IP explicitly, drop. */
if (!ipip_allow && (m->m_flags & (M_AUTH|M_CONF)) == 0) {
@@ -124,10 +122,6 @@ ip4_input(struct mbuf *m, ...)
return;
}
- va_start(ap, m);
- iphlen = va_arg(ap, int);
- va_end(ap);
-
ip = mtod(m, struct ip *);
ipip_input(m, iphlen, NULL, ip->ip_p);
@@ -611,7 +605,7 @@ ipe4_zeroize(struct tdb *tdbp)
}
void
-ipe4_input(struct mbuf *m, ...)
+ipe4_input(struct mbuf *m, int hlen, int proto)
{
/* This is a rather serious mistake, so no conditional printing. */
printf("ipe4_input(): should never be called\n");
diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h
index efec84a35c7..4780a873b8e 100644
--- a/sys/netinet/ip_ipsp.h
+++ b/sys/netinet/ip_ipsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.h,v 1.174 2016/09/15 03:37:09 dlg Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.175 2017/01/25 17:34:31 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -474,11 +474,11 @@ int tdb_walk(u_int, int (*)(struct tdb *, void *, int), void *);
int ipe4_attach(void);
int ipe4_init(struct tdb *, struct xformsw *, struct ipsecinit *);
int ipe4_zeroize(struct tdb *);
-void ipe4_input(struct mbuf *, ...);
+void ipe4_input(struct mbuf *, int, int);
void ipip_input(struct mbuf *, int, struct ifnet *, int);
int ipip_output(struct mbuf *, struct tdb *, struct mbuf **, int, int);
-void ip4_input(struct mbuf *, ...);
+void ip4_input(struct mbuf *, int, int);
#ifdef INET6
int ip4_input6(struct mbuf **, int *, int);
@@ -492,7 +492,7 @@ int ah_input(struct mbuf *, struct tdb *, int, int);
int ah_output(struct mbuf *, struct tdb *, struct mbuf **, int, int);
int ah_sysctl(int *, u_int, void *, size_t *, void *, size_t);
-void ah4_input(struct mbuf *, ...);
+void ah4_input(struct mbuf *, int, int);
void *ah4_ctlinput(int, struct sockaddr *, u_int, void *);
void *udpencap_ctlinput(int, struct sockaddr *, u_int, void *);
@@ -508,7 +508,7 @@ int esp_input(struct mbuf *, struct tdb *, int, int);
int esp_output(struct mbuf *, struct tdb *, struct mbuf **, int, int);
int esp_sysctl(int *, u_int, void *, size_t *, void *, size_t);
-void esp4_input(struct mbuf *, ...);
+void esp4_input(struct mbuf *, int, int);
void *esp4_ctlinput(int, struct sockaddr *, u_int, void *);
#ifdef INET6
@@ -523,7 +523,7 @@ int ipcomp_input(struct mbuf *, struct tdb *, int, int);
int ipcomp_output(struct mbuf *, struct tdb *, struct mbuf **, int, int);
int ipcomp_sysctl(int *, u_int, void *, size_t *, void *, size_t);
-void ipcomp4_input(struct mbuf *, ...);
+void ipcomp4_input(struct mbuf *, int, int);
#ifdef INET6
int ipcomp6_input(struct mbuf **, int *, int);
diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h
index 7d1663dc8b3..003c6a75bb2 100644
--- a/sys/netinet/ip_var.h
+++ b/sys/netinet/ip_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_var.h,v 1.65 2016/12/19 09:22:24 rzalamena Exp $ */
+/* $OpenBSD: ip_var.h,v 1.66 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */
/*
@@ -252,7 +252,7 @@ void ipv4_input(struct mbuf *);
void ip_forward(struct mbuf *, struct ifnet *, struct rtentry *, int);
int rip_ctloutput(int, struct socket *, int, int, struct mbuf **);
void rip_init(void);
-void rip_input(struct mbuf *, ...);
+void rip_input(struct mbuf *, int, int);
int rip_output(struct mbuf *, ...);
int rip_usrreq(struct socket *,
int, struct mbuf *, struct mbuf *, struct mbuf *, struct proc *);
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c
index 1686484bd5c..d181d5d89e1 100644
--- a/sys/netinet/ipsec_input.c
+++ b/sys/netinet/ipsec_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_input.c,v 1.138 2017/01/23 09:10:06 mpi Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.139 2017/01/25 17:34:31 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -697,15 +697,8 @@ ipcomp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
/* IPv4 AH wrapper. */
void
-ah4_input(struct mbuf *m, ...)
+ah4_input(struct mbuf *m, int skip, int proto)
{
- int skip;
-
- va_list ap;
- va_start(ap, m);
- skip = va_arg(ap, int);
- va_end(ap);
-
ipsec_common_input(m, skip, offsetof(struct ip, ip_p), AF_INET,
IPPROTO_AH, 0);
return;
@@ -744,15 +737,8 @@ ah4_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v)
/* IPv4 ESP wrapper. */
void
-esp4_input(struct mbuf *m, ...)
+esp4_input(struct mbuf *m, int skip, int proto)
{
- int skip;
-
- va_list ap;
- va_start(ap, m);
- skip = va_arg(ap, int);
- va_end(ap);
-
ipsec_common_input(m, skip, offsetof(struct ip, ip_p), AF_INET,
IPPROTO_ESP, 0);
}
@@ -777,14 +763,8 @@ esp4_input_cb(struct mbuf *m, ...)
/* IPv4 IPCOMP wrapper */
void
-ipcomp4_input(struct mbuf *m, ...)
+ipcomp4_input(struct mbuf *m, int skip, int proto)
{
- int skip;
- va_list ap;
- va_start(ap, m);
- skip = va_arg(ap, int);
- va_end(ap);
-
ipsec_common_input(m, skip, offsetof(struct ip, ip_p), AF_INET,
IPPROTO_IPCOMP, 0);
}
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 0ee9070c5e3..5a02613ca4f 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip.c,v 1.92 2017/01/23 16:31:24 bluhm Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.93 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
@@ -116,7 +116,7 @@ rip_init(void)
struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET };
void
-rip_input(struct mbuf *m, ...)
+rip_input(struct mbuf *m, int hlen, int proto)
{
struct ip *ip = mtod(m, struct ip *);
struct inpcb *inp, *last = NULL;
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 610a7ca165f..c16afb14e3b 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.335 2017/01/10 09:01:18 mpi Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.336 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -367,7 +367,7 @@ tcp6_input(struct mbuf **mp, int *offp, int proto)
* protocol specification dated September, 1981 very closely.
*/
void
-tcp_input(struct mbuf *m, ...)
+tcp_input(struct mbuf *m, int iphlen, int proto)
{
struct ip *ip;
struct inpcb *inp = NULL;
@@ -383,8 +383,6 @@ tcp_input(struct mbuf *m, ...)
tcp_seq iss, *reuse = NULL;
u_long tiwin;
struct tcp_opt_info opti;
- int iphlen;
- va_list ap;
struct tcphdr *th;
#ifdef INET6
struct ip6_hdr *ip6 = NULL;
@@ -400,10 +398,6 @@ tcp_input(struct mbuf *m, ...)
u_char iptos;
#endif
- va_start(ap, m);
- iphlen = va_arg(ap, int);
- va_end(ap);
-
tcpstat.tcps_rcvtotal++;
opti.ts_present = 0;
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 32f7913dc7c..f1f7c269328 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_var.h,v 1.117 2016/11/16 08:50:33 mpi Exp $ */
+/* $OpenBSD: tcp_var.h,v 1.118 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
@@ -613,7 +613,7 @@ void tcp_init(void);
#ifdef INET6
int tcp6_input(struct mbuf **, int *, int);
#endif
-void tcp_input(struct mbuf *, ...);
+void tcp_input(struct mbuf *, int, int);
int tcp_mss(struct tcpcb *, int);
void tcp_mss_update(struct tcpcb *);
u_int tcp_hdrsz(struct tcpcb *);
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 22e1513cdb2..6020c90a961 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.226 2016/12/19 15:47:19 mpi Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.227 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -159,15 +159,14 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
#endif
void
-udp_input(struct mbuf *m, ...)
+udp_input(struct mbuf *m, int iphlen, int proto)
{
struct ip *ip;
struct udphdr *uh;
struct inpcb *inp = NULL;
struct mbuf *opts = NULL;
struct ip save_ip;
- int iphlen, len;
- va_list ap;
+ int len;
u_int16_t savesum;
union {
struct sockaddr sa;
@@ -189,10 +188,6 @@ udp_input(struct mbuf *m, ...)
u_int32_t ipsecflowinfo = 0;
#endif /* define(IPSEC) || defined(PIPEX) */
- va_start(ap, m);
- iphlen = va_arg(ap, int);
- va_end(ap);
-
udpstat_inc(udps_ipackets);
switch (mtod(m, struct ip *)->ip_v) {
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h
index 5ebaa0fcbf2..6b6911ae5fb 100644
--- a/sys/netinet/udp_var.h
+++ b/sys/netinet/udp_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_var.h,v 1.28 2016/11/18 02:53:47 dlg Exp $ */
+/* $OpenBSD: udp_var.h,v 1.29 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: udp_var.h,v 1.12 1996/02/13 23:44:41 christos Exp $ */
/*
@@ -142,7 +142,7 @@ int udp6_input(struct mbuf **, int *, int);
#endif /* INET6 */
void *udp_ctlinput(int, struct sockaddr *, u_int, void *);
void udp_init(void);
-void udp_input(struct mbuf *, ...);
+void udp_input(struct mbuf *, int, int);
#ifdef INET6
int udp6_output(struct inpcb *, struct mbuf *, struct mbuf *,
struct mbuf *);
diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h
index 325cda58a0b..b25de61ee8f 100644
--- a/sys/sys/protosw.h
+++ b/sys/sys/protosw.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: protosw.h,v 1.18 2013/04/24 10:17:08 mpi Exp $ */
+/* $OpenBSD: protosw.h,v 1.19 2017/01/25 17:34:31 bluhm Exp $ */
/* $NetBSD: protosw.h,v 1.10 1996/04/09 20:55:32 cgd Exp $ */
/*-
@@ -69,7 +69,7 @@ struct protosw {
/* protocol-protocol hooks */
/* input to protocol (from below) */
- void (*pr_input)(struct mbuf *, ...);
+ void (*pr_input)(struct mbuf *, int, int);
/* output to protocol (from above) */
int (*pr_output)(struct mbuf *, ...);
/* control input (from below) */