Hello - This moves the 'struct protosw' declarations to use C99 initializers. Requested by mpi@
Index: kern/uipc_proto.c =================================================================== RCS file: /cvs/src/sys/kern/uipc_proto.c,v retrieving revision 1.11 diff -u -p -r1.11 uipc_proto.c --- kern/uipc_proto.c 5 Feb 2017 07:57:08 -0000 1.11 +++ kern/uipc_proto.c 19 Feb 2017 02:15:00 -0000 @@ -49,20 +49,53 @@ extern struct domain unixdomain; /* or at least forward */ struct protosw unixsw[] = { -{ SOCK_STREAM, &unixdomain, PF_LOCAL, PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, - 0, 0, 0, 0, - uipc_usrreq, - 0, 0, 0, 0, +{ + .pr_type = SOCK_STREAM, + .pr_domain = &unixdomain, + .pr_protocol = PF_LOCAL, + .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, + .pr_input = NULL, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = uipc_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL }, -{ SOCK_SEQPACKET,&unixdomain, PF_LOCAL, PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, - 0, 0, 0, 0, - uipc_usrreq, - 0, 0, 0, 0, +{ + .pr_type = SOCK_SEQPACKET, + .pr_domain = &unixdomain, + .pr_protocol = PF_LOCAL, + .pr_flags = PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, + .pr_input = NULL, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = uipc_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL }, -{ SOCK_DGRAM, &unixdomain, PF_LOCAL, PR_ATOMIC|PR_ADDR|PR_RIGHTS, - 0, 0, 0, 0, - uipc_usrreq, - 0, 0, 0, 0, +{ + .pr_type = SOCK_DGRAM, + .pr_domain = &unixdomain, + .pr_protocol = PF_LOCAL, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS, + .pr_input = NULL, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = uipc_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL } }; Index: net/pfkey.c =================================================================== RCS file: /cvs/src/sys/net/pfkey.c,v retrieving revision 1.36 diff -u -p -r1.36 pfkey.c --- net/pfkey.c 24 Jan 2017 10:08:30 -0000 1.36 +++ net/pfkey.c 19 Feb 2017 02:15:00 -0000 @@ -266,20 +266,20 @@ struct domain pfkeydomain = { }; static struct protosw pfkey_protosw_template = { - SOCK_RAW, - &pfkeydomain, - -1, /* protocol */ - PR_ATOMIC | PR_ADDR, - NULL, /* input */ - (void *) pfkey_output, - NULL, /* ctlinput */ - NULL, /* ctloutput */ - pfkey_usrreq, - NULL, /* init */ - NULL, /* fasttimo */ - NULL, /* slowtimo */ - NULL, /* drain */ - NULL /* sysctl */ + .pr_type = SOCK_RAW, + .pr_domain = &pfkeydomain, + .pr_protocol = -1, + .pr_flags = PR_ATOMIC | PR_ADDR, + .pr_input = NULL, + .pr_output = (void *) pfkey_output, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = pfkey_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL }; int Index: net/rtsock.c =================================================================== RCS file: /cvs/src/sys/net/rtsock.c,v retrieving revision 1.222 diff -u -p -r1.222 rtsock.c --- net/rtsock.c 1 Feb 2017 20:59:47 -0000 1.222 +++ net/rtsock.c 19 Feb 2017 02:15:00 -0000 @@ -1654,13 +1654,23 @@ sysctl_rtable_rtstat(void *oldp, size_t extern struct domain routedomain; /* or at least forward */ struct protosw routesw[] = { -{ SOCK_RAW, &routedomain, 0, PR_ATOMIC|PR_ADDR|PR_WANTRCVD, - 0, route_output, 0, route_ctloutput, - route_usrreq, - raw_init, 0, 0, 0, - sysctl_rtable, +{ + .pr_type = SOCK_RAW, + .pr_domain = &routedomain, + .pr_protocol = 0, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_WANTRCVD, + .pr_input = NULL, + .pr_output = route_output, + .pr_ctlinput = NULL, + .pr_ctloutput = route_ctloutput, + .pr_usrreq = route_usrreq, + .pr_init = raw_init, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = sysctl_rtable } -}; +}; struct domain routedomain = { PF_ROUTE, "route", route_init, 0, 0, Index: netinet/in_proto.c =================================================================== RCS file: /cvs/src/sys/netinet/in_proto.c,v retrieving revision 1.72 diff -u -p -r1.72 in_proto.c --- netinet/in_proto.c 29 Jan 2017 19:58:47 -0000 1.72 +++ netinet/in_proto.c 19 Feb 2017 02:15:00 -0000 @@ -175,138 +175,380 @@ u_char ip_protox[IPPROTO_MAX]; struct protosw inetsw[] = { -{ 0, &inetdomain, 0, 0, - 0, 0, 0, 0, - 0, - ip_init, 0, ip_slowtimo, ip_drain, ip_sysctl -}, -{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR|PR_SPLICE, - udp_input, 0, udp_ctlinput, ip_ctloutput, - udp_usrreq, - udp_init, 0, 0, 0, udp_sysctl -}, -{ SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS|PR_SPLICE, - tcp_input, 0, tcp_ctlinput, tcp_ctloutput, - tcp_usrreq, - tcp_init, 0, tcp_slowtimo, 0, tcp_sysctl -}, -{ SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, - rip_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, -}, -{ SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR, - icmp_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - icmp_init, 0, 0, 0, icmp_sysctl +{ + .pr_type = 0, + .pr_domain = &inetdomain, + .pr_protocol = 0, + .pr_flags = 0, + .pr_input = NULL, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = NULL, + .pr_init = ip_init, + .pr_fasttimo = NULL, + .pr_slowtimo = ip_slowtimo, + .pr_drain = ip_drain, + .pr_sysctl = ip_sysctl +}, +{ + .pr_type = SOCK_DGRAM, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_UDP, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_SPLICE, + .pr_input = udp_input, + .pr_output = NULL, + .pr_ctlinput = udp_ctlinput, + .pr_ctloutput = ip_ctloutput, + .pr_usrreq = udp_usrreq, + .pr_init = udp_init, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = udp_sysctl +}, +{ + .pr_type = SOCK_STREAM, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_TCP, + .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS|PR_SPLICE, + .pr_input = tcp_input, + .pr_output = NULL, + .pr_ctlinput = tcp_ctlinput, + .pr_ctloutput = tcp_ctloutput, + .pr_usrreq = tcp_usrreq, + .pr_init = tcp_init, + .pr_fasttimo = NULL, + .pr_slowtimo = tcp_slowtimo, + .pr_drain = NULL, + .pr_sysctl = tcp_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_RAW, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = rip_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_ICMP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = icmp_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = icmp_init, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = icmp_sysctl }, #if NGIF > 0 -{ SOCK_RAW, &inetdomain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR, - in_gif_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, ipip_sysctl -}, -{ SOCK_RAW, &inetdomain, IPPROTO_ETHERIP, PR_ATOMIC|PR_ADDR, - etherip_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, etherip_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_IPV4, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = in_gif_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ipip_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_ETHERIP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = etherip_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = etherip_sysctl }, #ifdef INET6 -{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, - in_gif_input, rip_output, 0, 0, - rip_usrreq, /*XXX*/ - 0, 0, 0, 0, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_IPV6, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = in_gif_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = rip_usrreq, /* XXX */ + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL }, #endif #ifdef MPLS -{ SOCK_RAW, &inetdomain, IPPROTO_MPLS, PR_ATOMIC|PR_ADDR, - etherip_input, rip_output, 0, 0, - rip_usrreq, - 0, 0, 0, 0, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_MPLS, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = etherip_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL }, #endif #else /* NGIF */ -{ SOCK_RAW, &inetdomain, IPPROTO_IPIP, PR_ATOMIC|PR_ADDR, - ip4_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, ipip_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_IPIP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = ip4_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ipip_sysctl }, #ifdef INET6 -{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, - ip4_input, rip_output, 0, rip_ctloutput, - rip_usrreq, /*XXX*/ - 0, 0, 0, 0, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_IPV6, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = ip4_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, /* XXX */ + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL }, #endif #endif /*NGIF*/ -{ SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR, - igmp_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - igmp_init, igmp_fasttimo, igmp_slowtimo, 0, igmp_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_IGMP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = igmp_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = igmp_init, + .pr_fasttimo = igmp_fasttimo, + .pr_slowtimo = igmp_slowtimo, + .pr_drain = NULL, + .pr_sysctl = igmp_sysctl }, #ifdef IPSEC -{ SOCK_RAW, &inetdomain, IPPROTO_AH, PR_ATOMIC|PR_ADDR, - ah4_input, rip_output, ah4_ctlinput, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, ah_sysctl -}, -{ SOCK_RAW, &inetdomain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR, - esp4_input, rip_output, esp4_ctlinput, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, esp_sysctl -}, -{ SOCK_RAW, &inetdomain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR, - ipcomp4_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, ipcomp_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .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, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ah_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .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, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = esp_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_IPCOMP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = ipcomp4_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ipcomp_sysctl }, #endif /* IPSEC */ #if NGRE > 0 -{ SOCK_RAW, &inetdomain, IPPROTO_GRE, PR_ATOMIC|PR_ADDR, - gre_input, rip_output, 0, rip_ctloutput, - gre_usrreq, - 0, 0, 0, 0, gre_sysctl -}, -{ SOCK_RAW, &inetdomain, IPPROTO_MOBILE, PR_ATOMIC|PR_ADDR, - gre_mobile_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, ipmobile_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_GRE, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = gre_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = gre_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = gre_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_MOBILE, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = gre_mobile_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ipmobile_sysctl }, #endif /* NGRE > 0 */ #if NCARP > 0 -{ SOCK_RAW, &inetdomain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR, - carp_proto_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, carp_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_CARP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = carp_proto_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = carp_sysctl }, #endif /* NCARP > 0 */ #if NPFSYNC > 0 -{ SOCK_RAW, &inetdomain, IPPROTO_PFSYNC, PR_ATOMIC|PR_ADDR, - pfsync_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, pfsync_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_PFSYNC, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = pfsync_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = pfsync_sysctl }, #endif /* NPFSYNC > 0 */ #if NPF > 0 -{ SOCK_RAW, &inetdomain, IPPROTO_DIVERT, PR_ATOMIC|PR_ADDR, - 0, 0, 0, rip_ctloutput, - divert_usrreq, - divert_init, 0, 0, 0, divert_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_DIVERT, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = NULL, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = divert_usrreq, + .pr_init = divert_init, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = divert_sysctl }, #endif /* NPF > 0 */ #if NETHERIP > 0 -{ SOCK_RAW, &inetdomain, IPPROTO_ETHERIP, PR_ATOMIC|PR_ADDR, - ip_etherip_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - 0, 0, 0, 0, ip_etherip_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_ETHERIP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = ip_etherip_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ip_etherip_sysctl }, #endif /* NETHERIP */ -/* raw wildcard */ -{ SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR, - rip_input, rip_output, 0, rip_ctloutput, - rip_usrreq, - rip_init, 0, 0, 0, -}, +{ + /* raw wildcard */ + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = 0, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = rip_input, + .pr_output = rip_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip_ctloutput, + .pr_usrreq = rip_usrreq, + .pr_init = rip_init, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL +} }; struct domain inetdomain = Index: netinet6/in6_proto.c =================================================================== RCS file: /cvs/src/sys/netinet6/in6_proto.c,v retrieving revision 1.88 diff -u -p -r1.88 in6_proto.c --- netinet6/in6_proto.c 29 Jan 2017 19:58:47 -0000 1.88 +++ netinet6/in6_proto.c 19 Feb 2017 02:15:00 -0000 @@ -122,125 +122,338 @@ u_char ip6_protox[IPPROTO_MAX]; struct protosw inet6sw[] = { -{ 0, &inet6domain, IPPROTO_IPV6, 0, - 0, 0, 0, 0, - 0, - ip6_init, 0, frag6_slowtimo, frag6_drain, - ip6_sysctl, -}, -{ SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR|PR_SPLICE, - udp_input, 0, udp6_ctlinput, ip6_ctloutput, - udp_usrreq, 0, - 0, 0, 0, - udp_sysctl, -}, -{ SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS|PR_SPLICE, - tcp_input, 0, tcp6_ctlinput, tcp_ctloutput, - tcp_usrreq, - 0, 0, 0, 0, - tcp_sysctl, -}, -{ SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, - rip6_input, rip6_output, rip6_ctlinput, rip6_ctloutput, - rip6_usrreq, - 0, 0, 0, 0, rip6_sysctl -}, -{ SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC|PR_ADDR, - icmp6_input, rip6_output, rip6_ctlinput, rip6_ctloutput, - rip6_usrreq, - icmp6_init, icmp6_fasttimo, 0, 0, - icmp6_sysctl, -}, -{ SOCK_RAW, &inet6domain, IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR, - dest6_input, 0, 0, 0, - 0, - 0, 0, 0, 0, -}, -{ SOCK_RAW, &inet6domain, IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR, - route6_input, 0, 0, 0, - 0, - 0, 0, 0, 0, -}, -{ SOCK_RAW, &inet6domain, IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR, - frag6_input, 0, 0, 0, - 0, - 0, 0, 0, 0, +{ + .pr_type = 0, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_IPV6, + .pr_flags = 0, + .pr_input = NULL, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = NULL, + .pr_init = ip6_init, + .pr_fasttimo = NULL, + .pr_slowtimo = frag6_slowtimo, + .pr_drain = frag6_drain, + .pr_sysctl = ip6_sysctl +}, +{ + .pr_type = SOCK_DGRAM, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_UDP, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_SPLICE, + .pr_input = udp_input, + .pr_output = NULL, + .pr_ctlinput = udp6_ctlinput, + .pr_ctloutput = ip6_ctloutput, + .pr_usrreq = udp_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = udp_sysctl +}, +{ + .pr_type = SOCK_STREAM, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_TCP, + .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS|PR_SPLICE, + .pr_input = tcp_input, + .pr_output = NULL, + .pr_ctlinput = tcp6_ctlinput, + .pr_ctloutput = tcp_ctloutput, + .pr_usrreq = tcp_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = tcp_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .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, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = rip6_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .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, + .pr_init = icmp6_init, + .pr_fasttimo = icmp6_fasttimo, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = icmp6_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_DSTOPTS, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = dest6_input, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = NULL, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_ROUTING, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = route6_input, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = NULL, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_FRAGMENT, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = frag6_input, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = NULL, + .pr_usrreq = NULL, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL }, #ifdef IPSEC -{ SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR, - ah6_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, - 0, 0, 0, 0, - ah_sysctl, -}, -{ SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR, - esp6_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, - 0, 0, 0, 0, - esp_sysctl, -}, -{ SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR, - ipcomp6_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, - 0, 0, 0, 0, - ipcomp_sysctl, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_AH, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = ah6_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ah_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_ESP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = esp6_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = esp_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_IPCOMP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = ipcomp6_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ipcomp_sysctl }, #endif /* IPSEC */ #if NGIF > 0 -{ SOCK_RAW, &inet6domain, IPPROTO_ETHERIP,PR_ATOMIC|PR_ADDR, - etherip_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, - 0, 0, 0, 0, etherip_sysctl -}, -{ SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, - in6_gif_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, /* XXX */ - 0, 0, 0, 0, -}, -{ SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR, - in6_gif_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, /* XXX */ - 0, 0, 0, 0, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_ETHERIP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = etherip_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = etherip_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_IPV6, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = in6_gif_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, /* XXX */ + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_IPV4, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = in6_gif_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, /* XXX */ + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL }, #else /* NGIF */ -{ SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, - ip4_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, /* XXX */ - 0, 0, 0, 0, ipip_sysctl -}, -{ SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR, - ip4_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, /* XXX */ - 0, 0, 0, 0, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_IPV6, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = ip4_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, /* XXX */ + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ipip_sysctl +}, +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_IPV4, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = ip4_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, /* XXX */ + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL, }, #endif /* GIF */ #if NCARP > 0 -{ SOCK_RAW, &inet6domain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR, - carp6_proto_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, - 0, 0, 0, 0, carp_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_CARP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = carp6_proto_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = carp_sysctl }, #endif /* NCARP */ #if NPF > 0 -{ SOCK_RAW, &inet6domain, IPPROTO_DIVERT, PR_ATOMIC|PR_ADDR, - 0, 0, 0, rip6_ctloutput, - divert6_usrreq, - divert6_init, 0, 0, 0, divert6_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_DIVERT, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = NULL, + .pr_output = NULL, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = divert6_usrreq, + .pr_init = divert6_init, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = divert6_sysctl }, #endif /* NPF > 0 */ #if NETHERIP > 0 -{ SOCK_RAW, &inet6domain, IPPROTO_ETHERIP,PR_ATOMIC|PR_ADDR, - ip6_etherip_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, - 0, 0, 0, 0, ip_etherip_sysctl +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_ETHERIP, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = ip6_etherip_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, + .pr_init = NULL, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = ip_etherip_sysctl }, #endif /* NETHERIP */ -/* raw wildcard */ -{ SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR, - rip6_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, rip6_init, - 0, 0, 0, -}, +{ + /* raw wildcard */ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = 0, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = rip6_input, + .pr_output = rip6_output, + .pr_ctlinput = NULL, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, + .pr_init = rip6_init, + .pr_fasttimo = NULL, + .pr_slowtimo = NULL, + .pr_drain = NULL, + .pr_sysctl = NULL +} }; struct domain inet6domain =