tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

eliminate struct protosw::pr_output



The ip_output function must be called as

	ip_output(m, opt, ro, flags, mopt, so)

where the arguments have the types

	struct mbuf *m;
	struct mbuf *opt;
	struct route *ro;
	int flags;
	struct ip_moptions *mopt;
	struct socket *so;

However, the prototype for ip_output is variadic:

	int ip_output(struct mbuf *, ...);

This is silly.  The only reason it is like this is that it is put in
the pr_output member of a struct protosw somewhere -- and then never
used via that path.  There's no way you could use it if you didn't
know the protocol you were using, so this pr_output member can't be
used anyway unless you know a priori that you're in netinet.  The same
is true of every other pr_output routine.

The only pr_output members that are ever actually used are (net/route)
rtsock's and (netipsec) keysock's, via raw_send.

The attached patch eliminates the pr_output member of struct protosw
(and struct ip6protosw), and adds an explicit (fully typed) callback
to raw_send for use by rtsock and keysock.

A subsequent patch may give ip_output &c. fully typed prototypes and
avoid varargs altogether, but I'll defer that for now.  I would like
to apply similar treatment to pr_input, but again in another (somewhat
more involved) patch.

Thoughts?  Objections?
Index: sys/net/if_stf.c
===================================================================
RCS file: /cvsroot/src/sys/net/if_stf.c,v
retrieving revision 1.82
diff -p -u -r1.82 if_stf.c
--- sys/net/if_stf.c	24 Aug 2015 22:21:26 -0000	1.82
+++ sys/net/if_stf.c	16 Jan 2016 23:28:10 -0000
@@ -165,7 +165,6 @@ static const struct protosw in_stf_proto
 	.pr_protocol	= IPPROTO_IPV6,
 	.pr_flags	= PR_ATOMIC|PR_ADDR,
 	.pr_input	= in_stf_input,
-	.pr_output	= rip_output,
 	.pr_ctlinput	= NULL,
 	.pr_ctloutput	= rip_ctloutput,
 	.pr_usrreqs	= &rip_usrreqs,
Index: sys/net/raw_cb.h
===================================================================
RCS file: /cvsroot/src/sys/net/raw_cb.h,v
retrieving revision 1.25
diff -p -u -r1.25 raw_cb.h
--- sys/net/raw_cb.h	2 May 2015 17:18:03 -0000	1.25
+++ sys/net/raw_cb.h	16 Jan 2016 23:28:10 -0000
@@ -71,7 +71,8 @@ int	raw_usrreq(struct socket *,
 void	raw_setsockaddr(struct rawcb *, struct sockaddr *);
 void	raw_setpeeraddr(struct rawcb *, struct sockaddr *);
 int	raw_send(struct socket *,
-	    struct mbuf *, struct sockaddr *, struct mbuf *, struct lwp *);
+	    struct mbuf *, struct sockaddr *, struct mbuf *, struct lwp *,
+	    int (*)(struct mbuf *, struct socket *));
 
 #endif /* _KERNEL */
 
Index: sys/net/raw_usrreq.c
===================================================================
RCS file: /cvsroot/src/sys/net/raw_usrreq.c,v
retrieving revision 1.54
diff -p -u -r1.54 raw_usrreq.c
--- sys/net/raw_usrreq.c	2 May 2015 17:18:03 -0000	1.54
+++ sys/net/raw_usrreq.c	16 Jan 2016 23:28:10 -0000
@@ -153,7 +153,8 @@ raw_setpeeraddr(struct rawcb *rp, struct
 
 int
 raw_send(struct socket *so, struct mbuf *m, struct sockaddr *nam,
-    struct mbuf *control, struct lwp *l)
+    struct mbuf *control, struct lwp *l,
+    int (*output)(struct mbuf *, struct socket *))
 {
 	struct rawcb *rp = sotorawcb(so);
 	int error = 0;
@@ -186,7 +187,7 @@ raw_send(struct socket *so, struct mbuf 
 			goto die;
 		}
 	}
-	error = (*so->so_proto->pr_output)(m, so);
+	error = (*output)(m, so);
 	if (nam)
 		raw_disconnect(rp);
 
Index: sys/net/rtsock.c
===================================================================
RCS file: /cvsroot/src/sys/net/rtsock.c,v
retrieving revision 1.174
diff -p -u -r1.174 rtsock.c
--- sys/net/rtsock.c	13 Oct 2015 21:28:34 -0000	1.174
+++ sys/net/rtsock.c	16 Jan 2016 23:28:10 -0000
@@ -151,7 +151,7 @@ struct route_info COMPATNAME(route_info)
 #define	PRESERVED_RTF	(RTF_UP | RTF_GATEWAY | RTF_HOST | RTF_DONE | RTF_MASK)
 
 static void COMPATNAME(route_init)(void);
-static int COMPATNAME(route_output)(struct mbuf *, ...);
+static int COMPATNAME(route_output)(struct mbuf *, struct socket *);
 
 static int rt_msg2(int, struct rt_addrinfo *, void *, struct rt_walkarg *, int *);
 static int rt_xaddrs(u_char, const char *, const char *, struct rt_addrinfo *);
@@ -165,6 +165,8 @@ static int sysctl_iflist(int, struct rt_
 static int sysctl_rtable(SYSCTLFN_PROTO);
 static void rt_adjustcount(int, int);
 
+static const struct protosw COMPATNAME(route_protosw)[];
+
 static void
 rt_adjustcount(int af, int cnt)
 {
@@ -390,9 +392,10 @@ COMPATNAME(route_send)(struct socket *so
 	int s;
 
 	KASSERT(solocked(so));
+	KASSERT(so->so_proto == &COMPATNAME(route_protosw)[0]);
 
 	s = splsoftnet();
-	error = raw_send(so, m, nam, control, l);
+	error = raw_send(so, m, nam, control, l, &COMPATNAME(route_output));
 	splx(s);
 
 	return error;
@@ -420,7 +423,7 @@ COMPATNAME(route_purgeif)(struct socket 
 
 /*ARGSUSED*/
 int
-COMPATNAME(route_output)(struct mbuf *m, ...)
+COMPATNAME(route_output)(struct mbuf *m, struct socket *so)
 {
 	struct sockproto proto = { .sp_family = PF_XROUTE, };
 	struct rt_xmsghdr *rtm = NULL;
@@ -431,14 +434,8 @@ COMPATNAME(route_output)(struct mbuf *m,
 	int len, error = 0;
 	struct ifnet *ifp = NULL;
 	struct ifaddr *ifa = NULL;
-	struct socket *so;
-	va_list ap;
 	sa_family_t family;
 
-	va_start(ap, m);
-	so = va_arg(ap, struct socket *);
-	va_end(ap);
-
 #define senderr(e) do { error = e; goto flush;} while (/*CONSTCOND*/ 0)
 	if (m == NULL || ((m->m_len < sizeof(int32_t)) &&
 	   (m = m_pullup(m, sizeof(int32_t))) == NULL))
@@ -1541,7 +1538,6 @@ static const struct protosw COMPATNAME(r
 		.pr_domain = &COMPATNAME(routedomain),
 		.pr_flags = PR_ATOMIC|PR_ADDR,
 		.pr_input = raw_input,
-		.pr_output = COMPATNAME(route_output),
 		.pr_ctlinput = raw_ctlinput,
 		.pr_usrreqs = &route_usrreqs,
 		.pr_init = raw_init,
Index: sys/netatalk/at_proto.c
===================================================================
RCS file: /cvsroot/src/sys/netatalk/at_proto.c,v
retrieving revision 1.18
diff -p -u -r1.18 at_proto.c
--- sys/netatalk/at_proto.c	18 May 2014 14:46:16 -0000	1.18
+++ sys/netatalk/at_proto.c	16 Jan 2016 23:28:10 -0000
@@ -55,7 +55,6 @@ const struct protosw atalksw[] = {
 	.pr_domain = &atalkdomain,
 	.pr_protocol = ATPROTO_DDP,
 	.pr_flags = PR_ATOMIC|PR_ADDR,
-	.pr_output = ddp_output,
 	.pr_usrreqs = &ddp_usrreqs,
 	.pr_init = ddp_init,
     },
Index: sys/netinet/if_arp.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/if_arp.c,v
retrieving revision 1.199
diff -p -u -r1.199 if_arp.c
--- sys/netinet/if_arp.c	5 Jan 2016 05:37:06 -0000	1.199
+++ sys/netinet/if_arp.c	16 Jan 2016 23:28:10 -0000
@@ -270,7 +270,6 @@ const struct protosw arpsw[] = {
 	  .pr_protocol = 0,
 	  .pr_flags = 0,
 	  .pr_input = 0,
-	  .pr_output = 0,
 	  .pr_ctlinput = 0,
 	  .pr_ctloutput = 0,
 	  .pr_usrreqs = 0,
Index: sys/netinet/in_gif.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/in_gif.c,v
retrieving revision 1.67
diff -p -u -r1.67 in_gif.c
--- sys/netinet/in_gif.c	25 Dec 2015 06:47:56 -0000	1.67
+++ sys/netinet/in_gif.c	16 Jan 2016 23:28:11 -0000
@@ -85,7 +85,6 @@ const struct protosw in_gif_protosw = {
 	.pr_protocol	= 0 /* IPPROTO_IPV[46] */,
 	.pr_flags	= PR_ATOMIC|PR_ADDR,
 	.pr_input	= in_gif_input,
-	.pr_output	= rip_output,
 	.pr_ctlinput	= NULL,
 	.pr_ctloutput	= rip_ctloutput,
 	.pr_usrreqs	= &rip_usrreqs,
Index: sys/netinet/in_proto.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/in_proto.c,v
retrieving revision 1.115
diff -p -u -r1.115 in_proto.c
--- sys/netinet/in_proto.c	13 Oct 2015 21:28:35 -0000	1.115
+++ sys/netinet/in_proto.c	16 Jan 2016 23:28:11 -0000
@@ -199,7 +199,6 @@ PR_WRAP_CTLINPUT(esp4_ctlinput)
 const struct protosw inetsw[] = {
 {	.pr_domain = &inetdomain,
 	.pr_init = ip_init,
-	.pr_output = ip_output,
 	.pr_fasttimo = ip_fasttimo,
 	.pr_slowtimo = ip_slowtimo,
 	.pr_drain = ip_drainstub,
@@ -276,7 +275,6 @@ const struct protosw inetsw[] = {
 	.pr_protocol = IPPROTO_RAW,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF,
 	.pr_input = rip_input,
-	.pr_output = rip_output,
 	.pr_ctlinput = rip_ctlinput,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_usrreqs = &rip_usrreqs,
@@ -286,7 +284,6 @@ const struct protosw inetsw[] = {
 	.pr_protocol = IPPROTO_ICMP,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = icmp_input,
-	.pr_output = rip_output,
 	.pr_ctlinput = rip_ctlinput,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_usrreqs = &rip_usrreqs,
@@ -326,7 +323,6 @@ const struct protosw inetsw[] = {
 	.pr_protocol = IPPROTO_IPV4,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = encap4_input,
-	.pr_output = rip_output,
 	.pr_ctlinput = rip_ctlinput,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_usrreqs = &rip_usrreqs,
@@ -338,7 +334,6 @@ const struct protosw inetsw[] = {
 	.pr_protocol = IPPROTO_IPV6,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = encap4_input,
-	.pr_output = rip_output,
 	.pr_ctlinput = rip_ctlinput,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_usrreqs = &rip_usrreqs,
@@ -351,7 +346,6 @@ const struct protosw inetsw[] = {
 	.pr_protocol = IPPROTO_ETHERIP,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = ip_etherip_input,
-	.pr_output = rip_output,
 	.pr_ctlinput = rip_ctlinput,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_usrreqs = &rip_usrreqs,
@@ -363,7 +357,6 @@ const struct protosw inetsw[] = {
 	.pr_protocol = IPPROTO_CARP,
 	.pr_flags = PR_ATOMIC|PR_ADDR,
 	.pr_input = carp_proto_input,
-	.pr_output = rip_output,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_usrreqs = &rip_usrreqs,
 	.pr_init = carp_init,
@@ -375,7 +368,6 @@ const struct protosw inetsw[] = {
 	.pr_protocol = IPPROTO_PFSYNC,
 	.pr_flags	 = PR_ATOMIC|PR_ADDR,
 	.pr_input	 = pfsync_input,
-	.pr_output	 = rip_output,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_usrreqs	 = &rip_usrreqs,
 },
@@ -385,7 +377,6 @@ const struct protosw inetsw[] = {
 	.pr_protocol = IPPROTO_IGMP,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = igmp_input, 
-	.pr_output = rip_output,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_ctlinput = rip_ctlinput,
 	.pr_usrreqs = &rip_usrreqs,
@@ -399,7 +390,6 @@ const struct protosw inetsw[] = {
 	.pr_protocol = IPPROTO_PIM,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = pim_input, 
-	.pr_output = rip_output,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_ctlinput = rip_ctlinput,
 	.pr_usrreqs = &rip_usrreqs,
@@ -410,7 +400,6 @@ const struct protosw inetsw[] = {
 	.pr_domain = &inetdomain,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = rip_input, 
-	.pr_output = rip_output,
 	.pr_ctloutput = rip_ctloutput,
 	.pr_ctlinput = rip_ctlinput,
 	.pr_usrreqs = &rip_usrreqs,
Index: sys/netinet/ip_mroute.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/ip_mroute.c,v
retrieving revision 1.132
diff -p -u -r1.132 ip_mroute.c
--- sys/netinet/ip_mroute.c	24 Aug 2015 22:21:26 -0000	1.132
+++ sys/netinet/ip_mroute.c	16 Jan 2016 23:28:11 -0000
@@ -196,7 +196,6 @@ static const struct protosw vif_protosw 
 	.pr_protocol	= IPPROTO_IPV4,
 	.pr_flags	= PR_ATOMIC|PR_ADDR,
 	.pr_input	= vif_input,
-	.pr_output	= rip_output,
 	.pr_ctloutput	= rip_ctloutput,
 	.pr_usrreqs	= &rip_usrreqs,
 };
Index: sys/netinet6/in6_gif.c
===================================================================
RCS file: /cvsroot/src/sys/netinet6/in6_gif.c,v
retrieving revision 1.64
diff -p -u -r1.64 in6_gif.c
--- sys/netinet6/in6_gif.c	25 Dec 2015 06:47:57 -0000	1.64
+++ sys/netinet6/in6_gif.c	16 Jan 2016 23:28:11 -0000
@@ -464,7 +464,6 @@ const struct ip6protosw in6_gif_protosw 
 	.pr_protocol	= 0 /* IPPROTO_IPV[46] */,
 	.pr_flags	= PR_ATOMIC | PR_ADDR,
 	.pr_input	= in6_gif_input,
-	.pr_output	= rip6_output,
 	.pr_ctlinput	= in6_gif_ctlinput,
 	.pr_ctloutput	= rip6_ctloutput,
 	.pr_usrreqs	= &rip6_usrreqs,
Index: sys/netinet6/in6_proto.c
===================================================================
RCS file: /cvsroot/src/sys/netinet6/in6_proto.c,v
retrieving revision 1.107
diff -p -u -r1.107 in6_proto.c
--- sys/netinet6/in6_proto.c	13 Oct 2015 21:28:35 -0000	1.107
+++ sys/netinet6/in6_proto.c	16 Jan 2016 23:28:11 -0000
@@ -288,7 +288,6 @@ const struct ip6protosw inet6sw[] = {
 	.pr_protocol = IPPROTO_RAW,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF,
 	.pr_input = rip6_input,
-	.pr_output = rip6_output,
 	.pr_ctlinput = rip6_ctlinput,
 	.pr_ctloutput = rip6_ctloutput,
 	.pr_usrreqs = &rip6_usrreqs,
@@ -305,7 +304,6 @@ const struct ip6protosw inet6sw[] = {
 	.pr_protocol = IPPROTO_ICMPV6,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = icmp6_input,
-	.pr_output = rip6_output,
 	.pr_ctlinput = rip6_ctlinput,
 	.pr_ctloutput = icmp6_ctloutput,
 	.pr_usrreqs = &rip6_usrreqs,
@@ -357,7 +355,6 @@ const struct ip6protosw inet6sw[] = {
 	.pr_protocol = IPPROTO_IPV4,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = encap6_input,
-	.pr_output = rip6_output,
 	.pr_ctlinput = encap6_ctlinput,
 	.pr_ctloutput = rip6_ctloutput,
 	.pr_usrreqs = &rip6_usrreqs,
@@ -369,7 +366,6 @@ const struct ip6protosw inet6sw[] = {
 	.pr_protocol = IPPROTO_IPV6,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = encap6_input,
-	.pr_output = rip6_output,
 	.pr_ctlinput = encap6_ctlinput,
 	.pr_ctloutput = rip6_ctloutput,
 	.pr_usrreqs = &rip6_usrreqs,
@@ -381,7 +377,6 @@ const struct ip6protosw inet6sw[] = {
 	.pr_protocol = IPPROTO_ETHERIP,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = ip6_etherip_input,
-	.pr_output = rip6_output,
 	.pr_ctlinput = rip6_ctlinput,
 	.pr_ctloutput = rip6_ctloutput,
 	.pr_usrreqs = &rip6_usrreqs,
@@ -393,7 +388,6 @@ const struct ip6protosw inet6sw[] = {
 	.pr_protocol = IPPROTO_CARP,
 	.pr_flags = PR_ATOMIC|PR_ADDR,
 	.pr_input = carp6_proto_input,
-	.pr_output = rip6_output,
 	.pr_ctloutput = rip6_ctloutput,
 	.pr_usrreqs = &rip6_usrreqs,
 },
@@ -403,7 +397,6 @@ const struct ip6protosw inet6sw[] = {
 	.pr_protocol = IPPROTO_PIM,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = pim6_input,
-	.pr_output = rip6_output,
 	.pr_ctloutput = rip6_ctloutput,
 	.pr_usrreqs = &rip6_usrreqs,
 	.pr_init = pim6_init,
@@ -413,7 +406,6 @@ const struct ip6protosw inet6sw[] = {
 	.pr_domain = &inet6domain,
 	.pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
 	.pr_input = rip6_input,
-	.pr_output = rip6_output,
 	.pr_ctloutput = rip6_ctloutput,
 	.pr_usrreqs = &rip6_usrreqs,
 	.pr_init = rip6_init,
Index: sys/netinet6/ip6protosw.h
===================================================================
RCS file: /cvsroot/src/sys/netinet6/ip6protosw.h,v
retrieving revision 1.22
diff -p -u -r1.22 ip6protosw.h
--- sys/netinet6/ip6protosw.h	18 May 2014 14:46:16 -0000	1.22
+++ sys/netinet6/ip6protosw.h	16 Jan 2016 23:28:11 -0000
@@ -120,9 +120,6 @@ struct ip6protosw {
 /* protocol-protocol hooks */
 	int	(*pr_input)		/* input to protocol (from below) */
 			(struct mbuf **, int *, int);
-	int	(*pr_output)		/* output to protocol (from above) */
-			(struct mbuf *, struct socket *, struct sockaddr_in6 *,
-			 struct mbuf *);
 	void	*(*pr_ctlinput)		/* control input (from below) */
 			(int, const struct sockaddr *, void *);
 	int	(*pr_ctloutput)		/* control output (from above) */
Index: sys/netipsec/keysock.c
===================================================================
RCS file: /cvsroot/src/sys/netipsec/keysock.c,v
retrieving revision 1.48
diff -p -u -r1.48 keysock.c
--- sys/netipsec/keysock.c	2 May 2015 17:18:04 -0000	1.48
+++ sys/netipsec/keysock.c	16 Jan 2016 23:28:11 -0000
@@ -61,8 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: keysock.c,v 
 #include <netipsec/ipsec_osdep.h>
 #include <netipsec/ipsec_private.h>
 
-typedef int	pr_output_t (struct mbuf *, struct socket *);
-
 struct key_cb {
 	int key_count;
 	int any_count;
@@ -78,6 +76,7 @@ static struct sockaddr key_src = {
     .sa_family = PF_KEY,
 };
 
+static const struct protosw keysw[];
 
 static int key_sendup0(struct rawcb *, struct mbuf *, int, int);
 
@@ -86,18 +85,12 @@ int key_registered_sb_max = (2048 * MHLE
 /*
  * key_output()
  */
-int
-key_output(struct mbuf *m, ...)
+static int
+key_output(struct mbuf *m, struct socket *so)
 {
 	struct sadb_msg *msg;
 	int len, error = 0;
 	int s;
-	struct socket *so;
-	va_list ap;
-
-	va_start(ap, m);
-	so = va_arg(ap, struct socket *);
-	va_end(ap);
 
 	if (m == 0)
 		panic("key_output: NULL pointer was passed");
@@ -638,9 +631,10 @@ key_send(struct socket *so, struct mbuf 
 	int s;
 
 	KASSERT(solocked(so));
+	KASSERT(so->so_proto == &keysw[0]);
 
 	s = splsoftnet();
-	error = raw_send(so, m, nam, control, l);
+	error = raw_send(so, m, nam, control, l, &key_output);
 	splx(s);
 
 	return error;
@@ -693,7 +687,7 @@ PR_WRAP_USRREQS(key)
 #define	key_sendoob	key_sendoob_wrapper
 #define	key_purgeif	key_purgeif_wrapper
 
-const struct pr_usrreqs key_usrreqs = {
+static const struct pr_usrreqs key_usrreqs = {
 	.pr_attach	= key_attach,
 	.pr_detach	= key_detach,
 	.pr_accept	= key_accept,
@@ -715,13 +709,12 @@ const struct pr_usrreqs key_usrreqs = {
 	.pr_purgeif	= key_purgeif,
 };
 
-const struct protosw keysw[] = {
+static const struct protosw keysw[] = {
     {
 	.pr_type = SOCK_RAW,
 	.pr_domain = &keydomain,
 	.pr_protocol = PF_KEY_V2,
 	.pr_flags = PR_ATOMIC|PR_ADDR,
-	.pr_output = key_output,
 	.pr_ctlinput = raw_ctlinput,
 	.pr_usrreqs = &key_usrreqs,
 	.pr_init = raw_init,
Index: sys/netipsec/keysock.h
===================================================================
RCS file: /cvsroot/src/sys/netipsec/keysock.h,v
retrieving revision 1.7
diff -p -u -r1.7 keysock.h
--- sys/netipsec/keysock.h	18 May 2014 14:46:16 -0000	1.7
+++ sys/netipsec/keysock.h	16 Jan 2016 23:28:11 -0000
@@ -70,7 +70,6 @@ struct keycb {
 	int kp_registered;	/* registered socket */
 };
 
-int key_output (struct mbuf *, ...);
 int key_sendup (struct socket *, struct sadb_msg *, u_int, int);
 int key_sendup_mbuf (struct socket *, struct mbuf *, int);
 #endif /* _KERNEL */
Index: sys/netipsec/xform_ipip.c
===================================================================
RCS file: /cvsroot/src/sys/netipsec/xform_ipip.c,v
retrieving revision 1.32
diff -p -u -r1.32 xform_ipip.c
--- sys/netipsec/xform_ipip.c	27 Mar 2015 07:47:10 -0000	1.32
+++ sys/netipsec/xform_ipip.c	16 Jan 2016 23:28:11 -0000
@@ -692,7 +692,6 @@ static struct ipprotosw ipe4_protosw = {
  .pr_protocol = IPPROTO_IPV4,
  .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
  .pr_input = ip4_input,
- .pr_output = 0,
  .pr_ctlinput = 0,
  .pr_ctloutput = rip_ctloutput,
  .pr_usrreqs = &rip_usrreqs,
@@ -713,7 +712,6 @@ static struct ip6protosw ipe4_protosw6 =
  .pr_protocol = IPPROTO_IPV6,
  .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
  .pr_input = ip4_input6,
- .pr_output = 0,
  .pr_ctlinput = 0,
  .pr_ctloutput = rip6_ctloutput,
  .pr_usrreqs = &rip6_usrreqs,
Index: sys/netnatm/natm_proto.c
===================================================================
RCS file: /cvsroot/src/sys/netnatm/natm_proto.c,v
retrieving revision 1.15
diff -p -u -r1.15 natm_proto.c
--- sys/netnatm/natm_proto.c	18 May 2014 14:46:16 -0000	1.15
+++ sys/netnatm/natm_proto.c	16 Jan 2016 23:28:11 -0000
@@ -62,7 +62,6 @@ const struct protosw natmsw[] = {
   .pr_protocol = PROTO_NATMAAL5,
   .pr_flags = PR_CONNREQUIRED,
   .pr_input = 0,
-  .pr_output = 0,
   .pr_ctlinput = 0,
   .pr_ctloutput = 0,
   .pr_usrreqs = &natm_usrreq,
@@ -76,7 +75,6 @@ const struct protosw natmsw[] = {
   .pr_protocol = PROTO_NATMAAL5,
   .pr_flags = PR_CONNREQUIRED | PR_ATOMIC,
   .pr_input = 0,
-  .pr_output = 0,
   .pr_ctlinput = 0,
   .pr_ctloutput = 0,
   .pr_usrreqs = &natm_usrreq,
@@ -90,7 +88,6 @@ const struct protosw natmsw[] = {
   .pr_protocol = PROTO_NATMAAL0,
   .pr_flags = PR_CONNREQUIRED,
   .pr_input = 0,
-  .pr_output = 0,
   .pr_ctlinput = 0,
   .pr_ctloutput = 0,
   .pr_usrreqs = &natm_usrreqs,
Index: sys/sys/protosw.h
===================================================================
RCS file: /cvsroot/src/sys/sys/protosw.h,v
retrieving revision 1.65
diff -p -u -r1.65 protosw.h
--- sys/sys/protosw.h	13 Oct 2015 21:28:34 -0000	1.65
+++ sys/sys/protosw.h	16 Jan 2016 23:28:11 -0000
@@ -77,8 +77,6 @@ struct protosw {
 /* protocol-protocol hooks */
 	void	(*pr_input)		/* input to protocol (from below) */
 			(struct mbuf *, ...);
-	int	(*pr_output)		/* output to protocol (from above) */
-			(struct mbuf *, ...);
 	void	*(*pr_ctlinput)		/* control input (from below) */
 			(int, const struct sockaddr *, void *);
 	int	(*pr_ctloutput)		/* control output (from above) */


Home | Main Index | Thread Index | Old Index