aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/if_gre.c4
-rw-r--r--sys/net/if_stf.c2
-rw-r--r--sys/net/rtsock.c4
-rw-r--r--sys/netinet/in_gif.c2
-rw-r--r--sys/netinet/ip_carp.c4
-rw-r--r--sys/netinet/ip_mroute.c2
-rw-r--r--sys/netinet/ip_var.h2
-rw-r--r--sys/netinet/raw_ip.c9
-rw-r--r--sys/netinet6/in6_gif.c2
-rw-r--r--sys/netinet6/in6_proto.c12
-rw-r--r--sys/netinet6/ip6_mroute.c2
-rw-r--r--sys/netipsec/keysock.c2
-rw-r--r--sys/netipsec/keysock.h2
-rw-r--r--sys/netpfil/pf/if_pfsync.c2
-rw-r--r--sys/sys/protosw.h2
15 files changed, 30 insertions, 23 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index c553dc83c344..302780a03b8c 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -128,7 +128,7 @@ static const struct protosw in_gre_protosw = {
.pr_protocol = IPPROTO_GRE,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = gre_input,
- .pr_output = (pr_output_t *)rip_output,
+ .pr_output = rip_output,
.pr_ctlinput = rip_ctlinput,
.pr_ctloutput = rip_ctloutput,
.pr_usrreqs = &rip_usrreqs
@@ -139,7 +139,7 @@ static const struct protosw in_mobile_protosw = {
.pr_protocol = IPPROTO_MOBILE,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = gre_mobile_input,
- .pr_output = (pr_output_t *)rip_output,
+ .pr_output = rip_output,
.pr_ctlinput = rip_ctlinput,
.pr_ctloutput = rip_ctloutput,
.pr_usrreqs = &rip_usrreqs
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c
index 14116cc87981..7b6fbcfb7418 100644
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -171,7 +171,7 @@ struct protosw in_stf_protosw = {
.pr_protocol = IPPROTO_IPV6,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = in_stf_input,
- .pr_output = (pr_output_t *)rip_output,
+ .pr_output = rip_output,
.pr_ctloutput = rip_ctloutput,
.pr_usrreqs = &rip_usrreqs
};
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index a8cb57760f65..c7f22681dd6f 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -159,7 +159,7 @@ static int rt_xaddrs(caddr_t cp, caddr_t cplim,
static int sysctl_dumpentry(struct radix_node *rn, void *vw);
static int sysctl_iflist(int af, struct walkarg *w);
static int sysctl_ifmalist(int af, struct walkarg *w);
-static int route_output(struct mbuf *m, struct socket *so);
+static int route_output(struct mbuf *m, struct socket *so, ...);
static void rt_getmetrics(const struct rtentry *rt, struct rt_metrics *out);
static void rt_dispatch(struct mbuf *, sa_family_t);
static struct sockaddr *rtsock_fix_netmask(struct sockaddr *dst,
@@ -516,7 +516,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
/*ARGSUSED*/
static int
-route_output(struct mbuf *m, struct socket *so)
+route_output(struct mbuf *m, struct socket *so, ...)
{
struct rt_msghdr *rtm = NULL;
struct rtentry *rt = NULL;
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c
index 6ee1634c9a23..d84066ae7e9d 100644
--- a/sys/netinet/in_gif.c
+++ b/sys/netinet/in_gif.c
@@ -81,7 +81,7 @@ struct protosw in_gif_protosw = {
.pr_protocol = 0/* IPPROTO_IPV[46] */,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = in_gif_input,
- .pr_output = (pr_output_t *)rip_output,
+ .pr_output = rip_output,
.pr_ctloutput = rip_ctloutput,
.pr_usrreqs = &rip_usrreqs
};
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 1600f8c022ad..17bc0e79f693 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -2054,7 +2054,7 @@ static struct protosw in_carp_protosw = {
.pr_protocol = IPPROTO_CARP,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = carp_input,
- .pr_output = (pr_output_t *)rip_output,
+ .pr_output = rip_output,
.pr_ctloutput = rip_ctloutput,
.pr_usrreqs = &rip_usrreqs
};
@@ -2068,7 +2068,7 @@ static struct protosw in6_carp_protosw = {
.pr_protocol = IPPROTO_CARP,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = carp6_input,
- .pr_output = (pr_output_t *)rip6_output,
+ .pr_output = rip6_output,
.pr_ctloutput = rip6_ctloutput,
.pr_usrreqs = &rip6_usrreqs
};
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 6c4a0d75426e..05605a810c68 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -247,7 +247,7 @@ static const struct protosw in_pim_protosw = {
.pr_protocol = IPPROTO_PIM,
.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
.pr_input = pim_input,
- .pr_output = (pr_output_t *)rip_output,
+ .pr_output = rip_output,
.pr_ctloutput = rip_ctloutput,
.pr_usrreqs = &rip_usrreqs
};
diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h
index 4b4b135217f1..c2ab8b43d843 100644
--- a/sys/netinet/ip_var.h
+++ b/sys/netinet/ip_var.h
@@ -235,7 +235,7 @@ void rip_init(void);
void rip_destroy(void);
#endif
int rip_input(struct mbuf **, int *, int);
-int rip_output(struct mbuf *, struct socket *, u_long);
+int rip_output(struct mbuf *, struct socket *, ...);
int ipip_input(struct mbuf **, int *, int);
int rsvp_input(struct mbuf **, int *, int);
int ip_rsvp_init(struct socket *);
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 1c90d0c1dedb..99706312db0f 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$");
#include <netipsec/ipsec.h>
#endif /*IPSEC*/
+#include <machine/stdarg.h>
#include <security/mac/mac_framework.h>
VNET_DEFINE(int, ip_defttl) = IPDEFTTL;
@@ -426,14 +427,20 @@ rip_input(struct mbuf **mp, int *offp, int proto)
* have setup with control call.
*/
int
-rip_output(struct mbuf *m, struct socket *so, u_long dst)
+rip_output(struct mbuf *m, struct socket *so, ...)
{
struct ip *ip;
int error;
struct inpcb *inp = sotoinpcb(so);
+ va_list ap;
+ u_long dst;
int flags = ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) |
IP_ALLOWBROADCAST;
+ va_start(ap, so);
+ dst = va_arg(ap, u_long);
+ va_end(ap);
+
/*
* If the user handed us a complete IP packet, use it. Otherwise,
* allocate an mbuf for a header and fill it in.
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c
index f740b375c3b2..b792ed57b5cb 100644
--- a/sys/netinet6/in6_gif.c
+++ b/sys/netinet6/in6_gif.c
@@ -89,7 +89,7 @@ struct protosw in6_gif_protosw = {
.pr_protocol = 0, /* IPPROTO_IPV[46] */
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = in6_gif_input,
- .pr_output = (pr_output_t *)rip6_output,
+ .pr_output = rip6_output,
.pr_ctloutput = rip6_ctloutput,
.pr_usrreqs = &rip6_usrreqs
};
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index 209dc3a30180..8e8baec8827f 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -233,7 +233,7 @@ struct protosw inet6sw[] = {
.pr_protocol = IPPROTO_RAW,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = rip6_input,
- .pr_output = (pr_output_t *)rip6_output,
+ .pr_output = rip6_output,
.pr_ctlinput = rip6_ctlinput,
.pr_ctloutput = rip6_ctloutput,
#ifndef INET /* Do not call initialization twice. */
@@ -247,7 +247,7 @@ struct protosw inet6sw[] = {
.pr_protocol = IPPROTO_ICMPV6,
.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
.pr_input = icmp6_input,
- .pr_output = (pr_output_t *)rip6_output,
+ .pr_output = rip6_output,
.pr_ctlinput = rip6_ctlinput,
.pr_ctloutput = rip6_ctloutput,
.pr_fasttimo = icmp6_fasttimo,
@@ -312,7 +312,7 @@ struct protosw inet6sw[] = {
.pr_protocol = IPPROTO_IPV4,
.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
.pr_input = encap6_input,
- .pr_output = (pr_output_t *)rip6_output,
+ .pr_output = rip6_output,
.pr_ctloutput = rip6_ctloutput,
.pr_init = encap_init,
.pr_usrreqs = &rip6_usrreqs
@@ -324,7 +324,7 @@ struct protosw inet6sw[] = {
.pr_protocol = IPPROTO_IPV6,
.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
.pr_input = encap6_input,
- .pr_output = (pr_output_t *)rip6_output,
+ .pr_output = rip6_output,
.pr_ctloutput = rip6_ctloutput,
.pr_init = encap_init,
.pr_usrreqs = &rip6_usrreqs
@@ -335,7 +335,7 @@ struct protosw inet6sw[] = {
.pr_protocol = IPPROTO_PIM,
.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
.pr_input = encap6_input,
- .pr_output = (pr_output_t *)rip6_output,
+ .pr_output = rip6_output,
.pr_ctloutput = rip6_ctloutput,
.pr_usrreqs = &rip6_usrreqs
},
@@ -354,7 +354,7 @@ IP6PROTOSPACER,
.pr_domain = &inet6domain,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = rip6_input,
- .pr_output = (pr_output_t *)rip6_output,
+ .pr_output = rip6_output,
.pr_ctloutput = rip6_ctloutput,
.pr_usrreqs = &rip6_usrreqs
},
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index 77bff1f4fdcb..daf43f66875b 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -146,7 +146,7 @@ static const struct protosw in6_pim_protosw = {
.pr_protocol = IPPROTO_PIM,
.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
.pr_input = pim6_input,
- .pr_output = (pr_output_t *)rip6_output,
+ .pr_output = rip6_output,
.pr_ctloutput = rip6_ctloutput,
.pr_usrreqs = &rip6_usrreqs
};
diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c
index 55f34dcc2f13..b72ada297696 100644
--- a/sys/netipsec/keysock.c
+++ b/sys/netipsec/keysock.c
@@ -88,7 +88,7 @@ VNET_PCPUSTAT_SYSUNINIT(pfkeystat);
* key_output()
*/
int
-key_output(struct mbuf *m, struct socket *so)
+key_output(struct mbuf *m, struct socket *so, ...)
{
struct sadb_msg *msg;
int len, error = 0;
diff --git a/sys/netipsec/keysock.h b/sys/netipsec/keysock.h
index e40f9c3405fa..9e0139ee036c 100644
--- a/sys/netipsec/keysock.h
+++ b/sys/netipsec/keysock.h
@@ -76,7 +76,7 @@ VNET_PCPUSTAT_DECLARE(struct pfkeystat, pfkeystat);
VNET_PCPUSTAT_ADD(struct pfkeystat, pfkeystat, name, (val))
#define PFKEYSTAT_INC(name) PFKEYSTAT_ADD(name, 1)
-extern int key_output(struct mbuf *m, struct socket *so);
+extern int key_output(struct mbuf *m, struct socket *so, ...);
extern int key_usrreq __P((struct socket *,
int, struct mbuf *, struct mbuf *, struct mbuf *));
diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c
index d5a6ffae61d9..ffefbc4a883c 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -2281,7 +2281,7 @@ static struct protosw in_pfsync_protosw = {
.pr_protocol = IPPROTO_PFSYNC,
.pr_flags = PR_ATOMIC|PR_ADDR,
.pr_input = pfsync_input,
- .pr_output = (pr_output_t *)rip_output,
+ .pr_output = rip_output,
.pr_ctloutput = rip_ctloutput,
.pr_usrreqs = &rip_usrreqs
};
diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h
index ce8dd7423fad..ba45f946196f 100644
--- a/sys/sys/protosw.h
+++ b/sys/sys/protosw.h
@@ -65,7 +65,7 @@ struct sockopt;
*/
/* USE THESE FOR YOUR PROTOTYPES ! */
typedef int pr_input_t (struct mbuf **, int*, int);
-typedef int pr_output_t (struct mbuf *, struct socket *);
+typedef int pr_output_t (struct mbuf *, struct socket *, ...);
typedef void pr_ctlinput_t (int, struct sockaddr *, void *);
typedef int pr_ctloutput_t (struct socket *, struct sockopt *);
typedef void pr_init_t (void);