On Tue, May 09, 2017 at 01:38:07PM +0200, Alexander Bluhm wrote:
> Hi,
> 
> Remove rip_output() and rip6_output() from inetsw and inet6sw.  The
> rip_output() function is never called via the pr_output pointer.
> rip_usrreq(PRU_SEND) calls rip_output() directly.  raw_usrreq() is
> never called from inetsw.  Situation in inet and inet6 is analog.
> 
> ok?

OK.
Would be great if we could kill pr_output since only route and pfkey
sockets use this and rtsock code already has an own pr_usrreq handler
which falls back to raw_usrreq.
 
> bluhm
> 
> Index: netinet/in_proto.c
> ===================================================================
> RCS file: /cvs/src/sys/netinet/in_proto.c,v
> retrieving revision 1.76
> diff -u -p -r1.76 in_proto.c
> --- netinet/in_proto.c        13 Mar 2017 20:18:21 -0000      1.76
> +++ netinet/in_proto.c        9 May 2017 11:21:39 -0000
> @@ -215,7 +215,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_RAW,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = rip_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach
> @@ -226,7 +225,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_ICMP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = icmp_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -240,7 +238,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_IPV4,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = in_gif_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -253,7 +250,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_ETHERIP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = etherip_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -266,7 +262,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_IPV6,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = in_gif_input,
> -  .pr_output = rip_output,
>    .pr_usrreq = rip_usrreq, /* XXX */
>    .pr_attach = rip_attach
>  },
> @@ -278,7 +273,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_MPLS,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = etherip_input,
> -  .pr_output = rip_output,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach
>  },
> @@ -290,7 +284,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_IPIP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ip4_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -304,7 +297,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_IPV6,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ip4_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq, /* XXX */
>    .pr_attach = rip_attach
> @@ -317,7 +309,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_IGMP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = igmp_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -333,7 +324,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_AH,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ah4_input,
> -  .pr_output = rip_output,
>    .pr_ctlinput       = ah4_ctlinput,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
> @@ -346,7 +336,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_ESP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = esp4_input,
> -  .pr_output = rip_output,
>    .pr_ctlinput       = esp4_ctlinput,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
> @@ -359,7 +348,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_IPCOMP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ipcomp4_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -373,7 +361,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_GRE,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = gre_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = gre_usrreq,
>    .pr_attach = rip_attach,
> @@ -385,7 +372,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_MOBILE,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = gre_mobile_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -399,7 +385,6 @@ 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_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -413,7 +398,6 @@ 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_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -440,7 +424,6 @@ struct protosw inetsw[] = {
>    .pr_protocol       = IPPROTO_ETHERIP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ip_etherip_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> @@ -453,7 +436,6 @@ struct protosw inetsw[] = {
>    .pr_domain = &inetdomain,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = rip_input,
> -  .pr_output = rip_output,
>    .pr_ctloutput      = rip_ctloutput,
>    .pr_usrreq = rip_usrreq,
>    .pr_attach = rip_attach,
> Index: netinet6/in6_proto.c
> ===================================================================
> RCS file: /cvs/src/sys/netinet6/in6_proto.c,v
> retrieving revision 1.91
> diff -u -p -r1.91 in6_proto.c
> --- netinet6/in6_proto.c      13 Mar 2017 20:18:21 -0000      1.91
> +++ netinet6/in6_proto.c      9 May 2017 11:21:40 -0000
> @@ -160,7 +160,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_RAW,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = rip6_input,
> -  .pr_output = rip6_output,
>    .pr_ctlinput       = rip6_ctlinput,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,
> @@ -173,7 +172,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_ICMPV6,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = icmp6_input,
> -  .pr_output = rip6_output,
>    .pr_ctlinput       = rip6_ctlinput,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,
> @@ -210,7 +208,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_AH,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ah6_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,
>    .pr_attach = rip6_attach,
> @@ -222,7 +219,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_ESP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = esp6_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,
>    .pr_attach = rip6_attach,
> @@ -234,7 +230,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_IPCOMP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ipcomp6_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,
>    .pr_attach = rip6_attach,
> @@ -248,7 +243,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_ETHERIP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = etherip_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,
>    .pr_attach = rip6_attach,
> @@ -260,7 +254,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_IPV6,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = in6_gif_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,  /* XXX */
>    .pr_attach = rip6_attach
> @@ -271,7 +264,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_IPV4,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = in6_gif_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,  /* XXX */
>    .pr_attach = rip6_attach
> @@ -283,7 +275,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_IPV6,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ip4_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,  /* XXX */
>    .pr_attach = rip6_attach,
> @@ -295,7 +286,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_IPV4,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ip4_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,  /* XXX */
>    .pr_attach = rip6_attach
> @@ -308,7 +298,6 @@ struct protosw 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_usrreq = rip6_usrreq,
>    .pr_attach = rip6_attach,
> @@ -335,7 +324,6 @@ struct protosw inet6sw[] = {
>    .pr_protocol       = IPPROTO_ETHERIP,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = ip6_etherip_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,
>    .pr_attach = rip6_attach,
> @@ -348,7 +336,6 @@ struct protosw inet6sw[] = {
>    .pr_domain = &inet6domain,
>    .pr_flags  = PR_ATOMIC|PR_ADDR,
>    .pr_input  = rip6_input,
> -  .pr_output = rip6_output,
>    .pr_ctloutput      = rip6_ctloutput,
>    .pr_usrreq = rip6_usrreq,
>    .pr_attach = rip6_attach,
> 

-- 
:wq Claudio

Reply via email to