aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2014-08-15 02:43:02 +0000
committerKevin Lo <kevlo@FreeBSD.org>2014-08-15 02:43:02 +0000
commit73d76e77b613b979905eb52f71d79ccd1cf1a254 (patch)
tree90287a018d09f955a0b1cf0fd76ba4a32715f145 /sys/netinet
parent6e8f9f511379543f92eb2796153142164d4e6fc1 (diff)
Notes
Diffstat (limited to 'sys/netinet')
-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
5 files changed, 13 insertions, 6 deletions
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.