Hi, Now since raw_input() and route_input() are gone from pr_input, we can make the variable parameters of the protocol input functions fixed. I have decided to add the proto to make it similar to IPv6. My goal is to have one struct protosw for both IP versions.
ok? bluhm Index: net/if_etherip.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/net/if_etherip.c,v retrieving revision 1.12 diff -u -p -r1.12 if_etherip.c --- net/if_etherip.c 23 Jan 2017 11:37:29 -0000 1.12 +++ net/if_etherip.c 24 Jan 2017 21:03:07 -0000 @@ -405,7 +405,7 @@ ip_etherip_output(struct ifnet *ifp, str } 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); Index: net/if_etherip.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/net/if_etherip.h,v retrieving revision 1.2 diff -u -p -r1.2 if_etherip.h --- net/if_etherip.h 5 Dec 2015 22:16:27 -0000 1.2 +++ net/if_etherip.h 24 Jan 2017 21:03:07 -0000 @@ -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 *); Index: net/if_gif.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/net/if_gif.c,v retrieving revision 1.89 diff -u -p -r1.89 if_gif.c --- net/if_gif.c 23 Jan 2017 11:37:29 -0000 1.89 +++ net/if_gif.c 24 Jan 2017 21:03:07 -0000 @@ -716,17 +716,11 @@ in_gif_output(struct ifnet *ifp, int fam } 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; } Index: net/if_gif.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/net/if_gif.h,v retrieving revision 1.14 diff -u -p -r1.14 if_gif.h --- net/if_gif.h 28 Sep 2015 08:32:05 -0000 1.14 +++ net/if_gif.h 24 Jan 2017 21:03:07 -0000 @@ -49,7 +49,7 @@ extern LIST_HEAD(gif_softc_head, gif_sof 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_ */ Index: net/if_pfsync.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/net/if_pfsync.c,v retrieving revision 1.242 diff -u -p -r1.242 if_pfsync.c --- net/if_pfsync.c 23 Jan 2017 11:37:29 -0000 1.242 +++ net/if_pfsync.c 24 Jan 2017 21:03:07 -0000 @@ -635,7 +635,7 @@ pfsync_state_import(struct pfsync_state } 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 *); Index: net/if_pfsync.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/net/if_pfsync.h,v retrieving revision 1.49 diff -u -p -r1.49 if_pfsync.h --- net/if_pfsync.h 20 Jan 2017 05:03:48 -0000 1.49 +++ net/if_pfsync.h 24 Jan 2017 21:03:07 -0000 @@ -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); Index: netinet/igmp.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/igmp.c,v retrieving revision 1.60 diff -u -p -r1.60 igmp.c --- netinet/igmp.c 4 Jan 2017 04:56:24 -0000 1.60 +++ netinet/igmp.c 24 Jan 2017 21:03:07 -0000 @@ -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 * 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 Index: netinet/igmp_var.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/igmp_var.h,v retrieving revision 1.10 diff -u -p -r1.10 igmp_var.h --- netinet/igmp_var.h 4 Jan 2017 04:56:24 -0000 1.10 +++ netinet/igmp_var.h 24 Jan 2017 21:03:07 -0000 @@ -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); Index: netinet/ip_carp.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_carp.c,v retrieving revision 1.299 diff -u -p -r1.299 ip_carp.c --- netinet/ip_carp.c 23 Jan 2017 11:37:29 -0000 1.299 +++ netinet/ip_carp.c 24 Jan 2017 21:03:07 -0000 @@ -412,15 +412,9 @@ carp_hmac_verify(struct carp_vhost_entry } 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) { Index: netinet/ip_carp.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_carp.h,v retrieving revision 1.38 diff -u -p -r1.38 ip_carp.h --- netinet/ip_carp.h 6 Jun 2016 07:01:37 -0000 1.38 +++ netinet/ip_carp.h 24 Jan 2017 21:03:07 -0000 @@ -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); Index: netinet/ip_divert.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_divert.c,v retrieving revision 1.41 diff -u -p -r1.41 ip_divert.c --- netinet/ip_divert.c 19 Dec 2016 08:36:49 -0000 1.41 +++ netinet/ip_divert.c 24 Jan 2017 21:03:07 -0000 @@ -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); } Index: netinet/ip_divert.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_divert.h,v retrieving revision 1.6 diff -u -p -r1.6 ip_divert.h --- netinet/ip_divert.h 10 Jul 2014 03:17:59 -0000 1.6 +++ netinet/ip_divert.h 24 Jan 2017 21:03:07 -0000 @@ -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 *, Index: netinet/ip_ether.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_ether.c,v retrieving revision 1.81 diff -u -p -r1.81 ip_ether.c --- netinet/ip_ether.c 24 Sep 2016 14:51:37 -0000 1.81 +++ netinet/ip_ether.c 24 Jan 2017 21:03:07 -0000 @@ -89,17 +89,11 @@ 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 Index: netinet/ip_ether.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_ether.h,v retrieving revision 1.18 diff -u -p -r1.18 ip_ether.h --- netinet/ip_ether.h 14 Jul 2014 12:18:30 -0000 1.18 +++ netinet/ip_ether.h 24 Jan 2017 21:03:07 -0000 @@ -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 Index: netinet/ip_gre.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_gre.c,v retrieving revision 1.60 diff -u -p -r1.60 ip_gre.c --- netinet/ip_gre.c 3 Jan 2017 10:52:21 -0000 1.60 +++ netinet/ip_gre.c 24 Jan 2017 21:43:05 -0000 @@ -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_cha */ 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_c * 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; Index: netinet/ip_gre.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_gre.h,v retrieving revision 1.9 diff -u -p -r1.9 ip_gre.h --- netinet/ip_gre.h 12 Jan 2010 23:33:24 -0000 1.9 +++ netinet/ip_gre.h 24 Jan 2017 21:03:07 -0000 @@ -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); Index: netinet/ip_icmp.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_icmp.c,v retrieving revision 1.159 diff -u -p -r1.159 ip_icmp.c --- netinet/ip_icmp.c 20 Dec 2016 18:33:43 -0000 1.159 +++ netinet/ip_icmp.c 24 Jan 2017 21:03:07 -0000 @@ -128,7 +128,7 @@ int *icmpctl_vars[ICMPCTL_MAXID] = ICMPC 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 * 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: Index: netinet/ip_icmp.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_icmp.h,v retrieving revision 1.27 diff -u -p -r1.27 ip_icmp.h --- netinet/ip_icmp.h 7 Mar 2016 19:33:26 -0000 1.27 +++ netinet/ip_icmp.h 24 Jan 2017 21:03:07 -0000 @@ -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 *); Index: netinet/ip_input.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_input.c,v retrieving revision 1.291 diff -u -p -r1.291 ip_input.c --- netinet/ip_input.c 20 Dec 2016 18:33:43 -0000 1.291 +++ netinet/ip_input.c 24 Jan 2017 21:03:07 -0000 @@ -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); Index: netinet/ip_ipip.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_ipip.c,v retrieving revision 1.69 diff -u -p -r1.69 ip_ipip.c --- netinet/ip_ipip.c 7 Mar 2016 18:44:00 -0000 1.69 +++ netinet/ip_ipip.c 24 Jan 2017 21:03:07 -0000 @@ -110,11 +110,9 @@ ip4_input6(struct mbuf **mp, int *offp, * 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"); Index: netinet/ip_ipsp.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_ipsp.h,v retrieving revision 1.174 diff -u -p -r1.174 ip_ipsp.h --- netinet/ip_ipsp.h 15 Sep 2016 03:37:09 -0000 1.174 +++ netinet/ip_ipsp.h 24 Jan 2017 21:03:07 -0000 @@ -474,11 +474,11 @@ int tdb_walk(u_int, int (*)(struct tdb * 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 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 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 t 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); Index: netinet/ip_var.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_var.h,v retrieving revision 1.65 diff -u -p -r1.65 ip_var.h --- netinet/ip_var.h 19 Dec 2016 09:22:24 -0000 1.65 +++ netinet/ip_var.h 24 Jan 2017 21:03:07 -0000 @@ -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 *); Index: netinet/ipsec_input.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ipsec_input.c,v retrieving revision 1.138 diff -u -p -r1.138 ipsec_input.c --- netinet/ipsec_input.c 23 Jan 2017 09:10:06 -0000 1.138 +++ netinet/ipsec_input.c 24 Jan 2017 21:03:07 -0000 @@ -697,15 +697,8 @@ ipcomp_sysctl(int *name, u_int namelen, /* 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 *s /* 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); } Index: netinet/raw_ip.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/raw_ip.c,v retrieving revision 1.92 diff -u -p -r1.92 raw_ip.c --- netinet/raw_ip.c 23 Jan 2017 16:31:24 -0000 1.92 +++ netinet/raw_ip.c 24 Jan 2017 21:03:07 -0000 @@ -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; Index: netinet/tcp_input.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/tcp_input.c,v retrieving revision 1.335 diff -u -p -r1.335 tcp_input.c --- netinet/tcp_input.c 10 Jan 2017 09:01:18 -0000 1.335 +++ netinet/tcp_input.c 24 Jan 2017 21:03:07 -0000 @@ -367,7 +367,7 @@ tcp6_input(struct mbuf **mp, int *offp, * 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; @@ -399,10 +397,6 @@ tcp_input(struct mbuf *m, ...) #ifdef TCP_ECN u_char iptos; #endif - - va_start(ap, m); - iphlen = va_arg(ap, int); - va_end(ap); tcpstat.tcps_rcvtotal++; Index: netinet/tcp_var.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/tcp_var.h,v retrieving revision 1.117 diff -u -p -r1.117 tcp_var.h --- netinet/tcp_var.h 16 Nov 2016 08:50:33 -0000 1.117 +++ netinet/tcp_var.h 24 Jan 2017 21:03:07 -0000 @@ -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 *); Index: netinet/udp_usrreq.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/udp_usrreq.c,v retrieving revision 1.226 diff -u -p -r1.226 udp_usrreq.c --- netinet/udp_usrreq.c 19 Dec 2016 15:47:19 -0000 1.226 +++ netinet/udp_usrreq.c 24 Jan 2017 21:03:07 -0000 @@ -159,15 +159,14 @@ udp6_input(struct mbuf **mp, int *offp, #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; @@ -188,10 +187,6 @@ udp_input(struct mbuf *m, ...) #if defined(IPSEC) || defined(PIPEX) 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); Index: netinet/udp_var.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/udp_var.h,v retrieving revision 1.28 diff -u -p -r1.28 udp_var.h --- netinet/udp_var.h 18 Nov 2016 02:53:47 -0000 1.28 +++ netinet/udp_var.h 24 Jan 2017 21:03:07 -0000 @@ -142,7 +142,7 @@ int udp6_input(struct mbuf **, int *, in #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 *); Index: sys/protosw.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/sys/protosw.h,v retrieving revision 1.18 diff -u -p -r1.18 protosw.h --- sys/protosw.h 24 Apr 2013 10:17:08 -0000 1.18 +++ sys/protosw.h 24 Jan 2017 21:03:07 -0000 @@ -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) */