svn commit: r270008 - in head/sys: net netinet netinet6 netipsec netpfil/pf sys
Kevin Lo
kevlo at FreeBSD.org
Fri Aug 15 02:43:06 UTC 2014
Author: kevlo
Date: Fri Aug 15 02:43:02 2014
New Revision: 270008
URL: http://svnweb.freebsd.org/changeset/base/270008
Log:
Change pr_output's prototype to avoid the need for explicit casts.
This is a follow up to r269699.
Phabric: D564
Reviewed by: jhb
Modified:
head/sys/net/if_gre.c
head/sys/net/if_stf.c
head/sys/net/rtsock.c
head/sys/netinet/in_gif.c
head/sys/netinet/ip_carp.c
head/sys/netinet/ip_mroute.c
head/sys/netinet/ip_var.h
head/sys/netinet/raw_ip.c
head/sys/netinet6/in6_gif.c
head/sys/netinet6/in6_proto.c
head/sys/netinet6/ip6_mroute.c
head/sys/netipsec/keysock.c
head/sys/netipsec/keysock.h
head/sys/netpfil/pf/if_pfsync.c
head/sys/sys/protosw.h
Modified: head/sys/net/if_gre.c
==============================================================================
--- head/sys/net/if_gre.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/net/if_gre.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -128,7 +128,7 @@ static const struct protosw in_gre_proto
.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_pr
.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
Modified: head/sys/net/if_stf.c
==============================================================================
--- head/sys/net/if_stf.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/net/if_stf.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -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
};
Modified: head/sys/net/rtsock.c
==============================================================================
--- head/sys/net/rtsock.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/net/rtsock.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -159,7 +159,7 @@ static int rt_xaddrs(caddr_t cp, caddr_t
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,
/*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;
Modified: head/sys/netinet/in_gif.c
==============================================================================
--- head/sys/netinet/in_gif.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netinet/in_gif.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -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
};
Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netinet/ip_carp.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -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
};
Modified: head/sys/netinet/ip_mroute.c
==============================================================================
--- head/sys/netinet/ip_mroute.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netinet/ip_mroute.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -247,7 +247,7 @@ static const struct protosw in_pim_proto
.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
};
Modified: head/sys/netinet/ip_var.h
==============================================================================
--- head/sys/netinet/ip_var.h Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netinet/ip_var.h Fri Aug 15 02:43:02 2014 (r270008)
@@ -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 *);
Modified: head/sys/netinet/raw_ip.c
==============================================================================
--- head/sys/netinet/raw_ip.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netinet/raw_ip.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -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, i
* 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.
Modified: head/sys/netinet6/in6_gif.c
==============================================================================
--- head/sys/netinet6/in6_gif.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netinet6/in6_gif.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -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
};
Modified: head/sys/netinet6/in6_proto.c
==============================================================================
--- head/sys/netinet6/in6_proto.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netinet6/in6_proto.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -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
},
Modified: head/sys/netinet6/ip6_mroute.c
==============================================================================
--- head/sys/netinet6/ip6_mroute.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netinet6/ip6_mroute.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -146,7 +146,7 @@ static const struct protosw in6_pim_prot
.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
};
Modified: head/sys/netipsec/keysock.c
==============================================================================
--- head/sys/netipsec/keysock.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netipsec/keysock.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -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;
Modified: head/sys/netipsec/keysock.h
==============================================================================
--- head/sys/netipsec/keysock.h Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netipsec/keysock.h Fri Aug 15 02:43:02 2014 (r270008)
@@ -76,7 +76,7 @@ VNET_PCPUSTAT_DECLARE(struct 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 *));
Modified: head/sys/netpfil/pf/if_pfsync.c
==============================================================================
--- head/sys/netpfil/pf/if_pfsync.c Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/netpfil/pf/if_pfsync.c Fri Aug 15 02:43:02 2014 (r270008)
@@ -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
};
Modified: head/sys/sys/protosw.h
==============================================================================
--- head/sys/sys/protosw.h Thu Aug 14 23:38:04 2014 (r270007)
+++ head/sys/sys/protosw.h Fri Aug 15 02:43:02 2014 (r270008)
@@ -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);
More information about the svn-src-all
mailing list