2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * Copyright (c) 1982, 1986, 1988, 1993
34 * The Regents of the University of California.
35 * All rights reserved.
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
45 * 3. Neither the name of the University nor the names of its contributors
46 * may be used to endorse or promote products derived from this software
47 * without specific prior written permission.
49 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61 * @(#)raw_ip.c 8.2 (Berkeley) 1/4/94
64 #include <sys/cdefs.h>
65 __FBSDID("$FreeBSD$");
67 #include "opt_ipsec.h"
68 #include "opt_inet6.h"
69 #include "opt_route.h"
71 #include <sys/param.h>
72 #include <sys/errno.h>
74 #include <sys/kernel.h>
76 #include <sys/malloc.h>
80 #include <sys/protosw.h>
81 #include <sys/signalvar.h>
82 #include <sys/socket.h>
83 #include <sys/socketvar.h>
85 #include <sys/syslog.h>
88 #include <net/if_var.h>
89 #include <net/if_types.h>
90 #include <net/route.h>
93 #include <netinet/in.h>
94 #include <netinet/in_var.h>
95 #include <netinet/in_systm.h>
96 #include <netinet/in_pcb.h>
98 #include <netinet/icmp6.h>
99 #include <netinet/ip6.h>
100 #include <netinet/ip_var.h>
101 #include <netinet6/ip6_mroute.h>
102 #include <netinet6/in6_pcb.h>
103 #include <netinet6/ip6_var.h>
104 #include <netinet6/nd6.h>
105 #include <netinet6/raw_ip6.h>
106 #include <netinet6/in6_fib.h>
107 #include <netinet6/scope6_var.h>
108 #include <netinet6/send.h>
110 #include <netipsec/ipsec_support.h>
112 #include <machine/stdarg.h>
114 #define satosin6(sa) ((struct sockaddr_in6 *)(sa))
115 #define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa))
118 * Raw interface to IP6 protocol.
121 VNET_DECLARE(struct inpcbinfo, ripcbinfo);
122 #define V_ripcbinfo VNET(ripcbinfo)
124 extern u_long rip_sendspace;
125 extern u_long rip_recvspace;
127 VNET_PCPUSTAT_DEFINE(struct rip6stat, rip6stat);
128 VNET_PCPUSTAT_SYSINIT(rip6stat);
131 VNET_PCPUSTAT_SYSUNINIT(rip6stat);
135 * Hooks for multicast routing. They all default to NULL, so leave them not
136 * initialized and rely on BSS being set to 0.
140 * The socket used to communicate with the multicast routing daemon.
142 VNET_DEFINE(struct socket *, ip6_mrouter);
145 * The various mrouter functions.
147 int (*ip6_mrouter_set)(struct socket *, struct sockopt *);
148 int (*ip6_mrouter_get)(struct socket *, struct sockopt *);
149 int (*ip6_mrouter_done)(void);
150 int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, struct mbuf *);
151 int (*mrt6_ioctl)(u_long, caddr_t);
153 struct rip6_inp_match_ctx {
159 rip6_inp_match(const struct inpcb *inp, void *v)
161 struct rip6_inp_match_ctx *c = v;
162 struct ip6_hdr *ip6 = c->ip6;
163 int proto = c->proto;
165 /* XXX inp locking */
166 if ((inp->inp_vflag & INP_IPV6) == 0)
168 if (inp->inp_ip_p && inp->inp_ip_p != proto)
170 if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) &&
171 !IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, &ip6->ip6_dst))
173 if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) &&
174 !IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, &ip6->ip6_src))
181 * Setup generic address and protocol structures for raw_input routine, then
182 * pass them along with mbuf chain.
185 rip6_input(struct mbuf **mp, int *offp, int proto)
188 struct mbuf *n, *m = *mp;
189 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
191 struct mbuf *opts = NULL;
192 struct sockaddr_in6 fromsa;
193 struct rip6_inp_match_ctx ctx = { .ip6 = ip6, .proto = proto };
194 struct inpcb_iterator inpi = INP_ITERATOR(&V_ripcbinfo,
195 INPLOOKUP_RLOCKPCB, rip6_inp_match, &ctx);
200 RIP6STAT_INC(rip6s_ipackets);
202 init_sin6(&fromsa, m, 0); /* general init */
204 ifp = m->m_pkthdr.rcvif;
206 while ((inp = inp_next(&inpi)) != NULL) {
207 INP_RLOCK_ASSERT(inp);
208 #if defined(IPSEC) || defined(IPSEC_SUPPORT)
210 * Check AH/ESP integrity.
212 if (IPSEC_ENABLED(ipv6) &&
213 IPSEC_CHECK_POLICY(ipv6, m, inp) != 0) {
214 /* Do not inject data into pcb. */
218 if (jailed_without_vnet(inp->inp_cred) &&
219 !IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) &&
220 prison_check_ip6(inp->inp_cred, &ip6->ip6_dst) != 0)
222 * Allow raw socket in jail to receive multicast;
223 * assume process had PRIV_NETINET_RAW at attach,
224 * and fall through into normal filter path if so.
227 if (inp->in6p_cksum != -1) {
228 RIP6STAT_INC(rip6s_isum);
229 if (m->m_pkthdr.len - (*offp + inp->in6p_cksum) < 2 ||
230 in6_cksum(m, proto, *offp,
231 m->m_pkthdr.len - *offp)) {
232 RIP6STAT_INC(rip6s_badsum);
234 * Drop the received message, don't send an
235 * ICMP6 message. Set proto to IPPROTO_NONE
239 proto = IPPROTO_NONE;
244 * If this raw socket has multicast state, and we
245 * have received a multicast, check if this socket
246 * should receive it, as multicast filtering is now
247 * the responsibility of the transport layer.
249 if (inp->in6p_moptions &&
250 IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
252 * If the incoming datagram is for MLD, allow it
253 * through unconditionally to the raw socket.
255 * Use the M_RTALERT_MLD flag to check for MLD
256 * traffic without having to inspect the mbuf chain
257 * more deeply, as all MLDv1/v2 host messages MUST
258 * contain the Router Alert option.
260 * In the case of MLDv1, we may not have explicitly
261 * joined the group, and may have set IFF_ALLMULTI
262 * on the interface. im6o_mc_filter() may discard
263 * control traffic we actually need to see.
265 * Userland multicast routing daemons should continue
266 * filter the control traffic appropriately.
270 blocked = MCAST_PASS;
271 if ((m->m_flags & M_RTALERT_MLD) == 0) {
272 struct sockaddr_in6 mcaddr;
274 bzero(&mcaddr, sizeof(struct sockaddr_in6));
275 mcaddr.sin6_len = sizeof(struct sockaddr_in6);
276 mcaddr.sin6_family = AF_INET6;
277 mcaddr.sin6_addr = ip6->ip6_dst;
279 blocked = im6o_mc_filter(inp->in6p_moptions,
281 (struct sockaddr *)&mcaddr,
282 (struct sockaddr *)&fromsa);
284 if (blocked != MCAST_PASS) {
285 IP6STAT_INC(ip6s_notmember);
289 if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL)
291 if (inp->inp_flags & INP_CONTROLOPTS ||
292 inp->inp_socket->so_options & SO_TIMESTAMP)
293 ip6_savecontrol(inp, n, &opts);
294 /* strip intermediate headers */
296 if (sbappendaddr(&inp->inp_socket->so_rcv,
297 (struct sockaddr *)&fromsa, n, opts) == 0) {
298 soroverflow(inp->inp_socket);
302 RIP6STAT_INC(rip6s_fullsock);
304 sorwakeup(inp->inp_socket);
309 if (delivered == 0) {
310 RIP6STAT_INC(rip6s_nosock);
311 if (m->m_flags & M_MCAST)
312 RIP6STAT_INC(rip6s_nosockmcast);
313 if (proto == IPPROTO_NONE)
316 icmp6_error(m, ICMP6_PARAM_PROB,
317 ICMP6_PARAMPROB_NEXTHEADER,
318 ip6_get_prevhdr(m, *offp));
319 IP6STAT_DEC(ip6s_delivered);
322 return (IPPROTO_DONE);
326 rip6_ctlinput(struct ip6ctlparam *ip6cp)
330 if ((errno = icmp6_errmap(ip6cp->ip6c_icmp6)) != 0)
331 in6_pcbnotify(&V_ripcbinfo, ip6cp->ip6c_finaldst, 0,
332 ip6cp->ip6c_src, 0, errno, ip6cp->ip6c_cmdarg,
337 * Generate IPv6 header and pass packet to ip6_output. Tack on options user
338 * may have setup with control call.
341 rip6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
342 struct mbuf *control, struct thread *td)
344 struct epoch_tracker et;
346 struct sockaddr_in6 tmp, *dstsock;
349 u_int plen = m->m_pkthdr.len;
350 struct ip6_pktopts opt, *optp;
351 struct ifnet *oifp = NULL;
353 int type = 0, code = 0; /* for ICMPv6 output statistics only */
354 int scope_ambiguous = 0;
357 struct in6_addr in6a;
360 KASSERT(inp != NULL, ("rip6_send: inp == NULL"));
362 /* Always copy sockaddr to avoid overwrites. */
364 if (so->so_state & SS_ISCONNECTED) {
369 tmp = (struct sockaddr_in6 ){
370 .sin6_family = AF_INET6,
371 .sin6_len = sizeof(struct sockaddr_in6),
374 bcopy(&inp->in6p_faddr, &tmp.sin6_addr,
375 sizeof(struct in6_addr));
381 else if (nam->sa_family != AF_INET6)
382 error = EAFNOSUPPORT;
383 else if (nam->sa_len != sizeof(struct sockaddr_in6))
389 dstsock = (struct sockaddr_in6 *)nam;
390 if (dstsock->sin6_family != AF_INET6) {
391 error = EAFNOSUPPORT;
398 if (control != NULL) {
400 error = ip6_setpktopts(control, &opt, inp->in6p_outputopts,
401 so->so_cred, inp->inp_ip_p);
409 optp = inp->in6p_outputopts;
412 * Check and convert scope zone ID into internal form.
414 * XXX: we may still need to determine the zone later.
416 if (!(so->so_state & SS_ISCONNECTED)) {
417 if (!optp || !optp->ip6po_pktinfo ||
418 !optp->ip6po_pktinfo->ipi6_ifindex)
419 use_defzone = V_ip6_use_defzone;
420 if (dstsock->sin6_scope_id == 0 && !use_defzone)
422 if ((error = sa6_embedscope(dstsock, use_defzone)) != 0)
427 * For an ICMPv6 packet, we should know its type and code to update
430 if (inp->inp_ip_p == IPPROTO_ICMPV6) {
431 struct icmp6_hdr *icmp6;
432 if (m->m_len < sizeof(struct icmp6_hdr) &&
433 (m = m_pullup(m, sizeof(struct icmp6_hdr))) == NULL) {
437 icmp6 = mtod(m, struct icmp6_hdr *);
438 type = icmp6->icmp6_type;
439 code = icmp6->icmp6_code;
442 M_PREPEND(m, sizeof(*ip6), M_NOWAIT);
447 ip6 = mtod(m, struct ip6_hdr *);
450 if (CALC_FLOWID_OUTBOUND) {
451 uint32_t hash_type, hash_val;
453 hash_val = fib6_calc_software_hash(&inp->in6p_laddr,
454 &dstsock->sin6_addr, 0, 0, inp->inp_ip_p, &hash_type);
455 inp->inp_flowid = hash_val;
456 inp->inp_flowtype = hash_type;
460 * Source address selection.
463 error = in6_selectsrc_socket(dstsock, optp, inp, so->so_cred,
464 scope_ambiguous, &in6a, &hlim);
469 error = prison_check_ip6(inp->inp_cred, &in6a);
474 ip6->ip6_dst = dstsock->sin6_addr;
477 * Fill in the rest of the IPv6 header fields.
479 ip6->ip6_flow = (ip6->ip6_flow & ~IPV6_FLOWINFO_MASK) |
480 (inp->inp_flow & IPV6_FLOWINFO_MASK);
481 ip6->ip6_vfc = (ip6->ip6_vfc & ~IPV6_VERSION_MASK) |
482 (IPV6_VERSION & IPV6_VERSION_MASK);
485 * ip6_plen will be filled in ip6_output, so not fill it here.
487 ip6->ip6_nxt = inp->inp_ip_p;
488 ip6->ip6_hlim = hlim;
490 if (inp->inp_ip_p == IPPROTO_ICMPV6 || inp->in6p_cksum != -1) {
495 /* Compute checksum. */
496 if (inp->inp_ip_p == IPPROTO_ICMPV6)
497 off = offsetof(struct icmp6_hdr, icmp6_cksum);
499 off = inp->in6p_cksum;
500 if (plen < off + 2) {
504 off += sizeof(struct ip6_hdr);
507 while (n && n->m_len <= off) {
513 p = (u_int16_t *)(mtod(n, caddr_t) + off);
515 *p = in6_cksum(m, ip6->ip6_nxt, sizeof(*ip6), plen);
519 * Send RA/RS messages to user land for protection, before sending
520 * them to rtadvd/rtsol.
522 if ((send_sendso_input_hook != NULL) &&
523 inp->inp_ip_p == IPPROTO_ICMPV6) {
525 case ND_ROUTER_ADVERT:
526 case ND_ROUTER_SOLICIT:
527 mtag = m_tag_get(PACKET_TAG_ND_OUTGOING,
528 sizeof(unsigned short), M_NOWAIT);
531 m_tag_prepend(m, mtag);
536 error = ip6_output(m, optp, NULL, 0, inp->in6p_moptions, &oifp, inp);
538 if (inp->inp_ip_p == IPPROTO_ICMPV6) {
540 icmp6_ifoutstat_inc(oifp, type, code);
541 ICMP6STAT_INC(icp6s_outhist[type]);
543 RIP6STAT_INC(rip6s_opackets);
552 if (control != NULL) {
553 ip6_clearpktopts(&opt, -1);
567 * Raw IPv6 socket option processing.
570 rip6_ctloutput(struct socket *so, struct sockopt *sopt)
572 struct inpcb *inp = sotoinpcb(so);
575 if (sopt->sopt_level == IPPROTO_ICMPV6)
577 * XXX: is it better to call icmp6_ctloutput() directly
580 return (icmp6_ctloutput(so, sopt));
581 else if (sopt->sopt_level != IPPROTO_IPV6) {
582 if (sopt->sopt_level == SOL_SOCKET &&
583 sopt->sopt_name == SO_SETFIB) {
585 inp->inp_inc.inc_fibnum = so->so_fibnum;
594 switch (sopt->sopt_dir) {
596 switch (sopt->sopt_name) {
604 if (inp->inp_ip_p != IPPROTO_ICMPV6)
606 error = ip6_mrouter_get ? ip6_mrouter_get(so, sopt) :
610 error = ip6_raw_ctloutput(so, sopt);
613 error = ip6_ctloutput(so, sopt);
619 switch (sopt->sopt_name) {
627 if (inp->inp_ip_p != IPPROTO_ICMPV6)
629 error = ip6_mrouter_set ? ip6_mrouter_set(so, sopt) :
633 error = ip6_raw_ctloutput(so, sopt);
636 error = ip6_ctloutput(so, sopt);
646 rip6_attach(struct socket *so, int proto, struct thread *td)
649 struct icmp6_filter *filter;
653 KASSERT(inp == NULL, ("rip6_attach: inp != NULL"));
655 error = priv_check(td, PRIV_NETINET_RAW);
658 if (proto >= IPPROTO_MAX || proto < 0)
659 return (EPROTONOSUPPORT);
660 error = soreserve(so, rip_sendspace, rip_recvspace);
663 filter = malloc(sizeof(struct icmp6_filter), M_PCB, M_NOWAIT);
666 error = in_pcballoc(so, &V_ripcbinfo);
671 inp = (struct inpcb *)so->so_pcb;
672 inp->inp_ip_p = proto;
673 inp->in6p_cksum = -1;
674 inp->in6p_icmp6filt = filter;
675 ICMP6_FILTER_SETPASSALL(inp->in6p_icmp6filt);
681 rip6_detach(struct socket *so)
686 KASSERT(inp != NULL, ("rip6_detach: inp == NULL"));
688 if (so == V_ip6_mrouter && ip6_mrouter_done)
692 free(inp->in6p_icmp6filt, M_PCB);
697 /* XXXRW: This can't ever be called. */
699 rip6_abort(struct socket *so)
701 struct inpcb *inp __diagused;
704 KASSERT(inp != NULL, ("rip6_abort: inp == NULL"));
706 soisdisconnected(so);
710 rip6_close(struct socket *so)
712 struct inpcb *inp __diagused;
715 KASSERT(inp != NULL, ("rip6_close: inp == NULL"));
717 soisdisconnected(so);
721 rip6_disconnect(struct socket *so)
726 KASSERT(inp != NULL, ("rip6_disconnect: inp == NULL"));
728 if ((so->so_state & SS_ISCONNECTED) == 0)
730 inp->in6p_faddr = in6addr_any;
736 rip6_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
738 struct epoch_tracker et;
740 struct sockaddr_in6 *addr = (struct sockaddr_in6 *)nam;
741 struct ifaddr *ifa = NULL;
745 KASSERT(inp != NULL, ("rip6_bind: inp == NULL"));
747 if (nam->sa_family != AF_INET6)
748 return (EAFNOSUPPORT);
749 if (nam->sa_len != sizeof(*addr))
751 if ((error = prison_check_ip6(td->td_ucred, &addr->sin6_addr)) != 0)
753 if (CK_STAILQ_EMPTY(&V_ifnet) || addr->sin6_family != AF_INET6)
754 return (EADDRNOTAVAIL);
755 if ((error = sa6_embedscope(addr, V_ip6_use_defzone)) != 0)
759 if (!IN6_IS_ADDR_UNSPECIFIED(&addr->sin6_addr) &&
760 (ifa = ifa_ifwithaddr((struct sockaddr *)addr)) == NULL) {
762 return (EADDRNOTAVAIL);
765 ((struct in6_ifaddr *)ifa)->ia6_flags &
766 (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|
767 IN6_IFF_DETACHED|IN6_IFF_DEPRECATED)) {
769 return (EADDRNOTAVAIL);
773 INP_INFO_WLOCK(&V_ripcbinfo);
774 inp->in6p_laddr = addr->sin6_addr;
775 INP_INFO_WUNLOCK(&V_ripcbinfo);
781 rip6_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
784 struct sockaddr_in6 *addr = (struct sockaddr_in6 *)nam;
785 struct in6_addr in6a;
786 struct epoch_tracker et;
787 int error = 0, scope_ambiguous = 0;
790 KASSERT(inp != NULL, ("rip6_connect: inp == NULL"));
792 if (nam->sa_len != sizeof(*addr))
794 if (CK_STAILQ_EMPTY(&V_ifnet))
795 return (EADDRNOTAVAIL);
796 if (addr->sin6_family != AF_INET6)
797 return (EAFNOSUPPORT);
800 * Application should provide a proper zone ID or the use of default
801 * zone IDs should be enabled. Unfortunately, some applications do
802 * not behave as it should, so we need a workaround. Even if an
803 * appropriate ID is not determined, we'll see if we can determine
804 * the outgoing interface. If we can, determine the zone ID based on
805 * the interface below.
807 if (addr->sin6_scope_id == 0 && !V_ip6_use_defzone)
809 if ((error = sa6_embedscope(addr, V_ip6_use_defzone)) != 0)
813 INP_INFO_WLOCK(&V_ripcbinfo);
814 /* Source address selection. XXX: need pcblookup? */
816 error = in6_selectsrc_socket(addr, inp->in6p_outputopts,
817 inp, so->so_cred, scope_ambiguous, &in6a, NULL);
820 INP_INFO_WUNLOCK(&V_ripcbinfo);
825 inp->in6p_faddr = addr->sin6_addr;
826 inp->in6p_laddr = in6a;
828 INP_INFO_WUNLOCK(&V_ripcbinfo);
834 rip6_shutdown(struct socket *so)
839 KASSERT(inp != NULL, ("rip6_shutdown: inp == NULL"));
847 struct protosw rip6_protosw = {
849 .pr_flags = PR_ATOMIC|PR_ADDR,
850 .pr_ctloutput = rip6_ctloutput,
851 .pr_abort = rip6_abort,
852 .pr_attach = rip6_attach,
853 .pr_bind = rip6_bind,
854 .pr_connect = rip6_connect,
855 .pr_control = in6_control,
856 .pr_detach = rip6_detach,
857 .pr_disconnect = rip6_disconnect,
858 .pr_peeraddr = in6_getpeeraddr,
859 .pr_send = rip6_send,
860 .pr_shutdown = rip6_shutdown,
861 .pr_sockaddr = in6_getsockaddr,
862 .pr_close = rip6_close