diff options
author | 2016-12-22 11:04:44 +0000 | |
---|---|---|
committer | 2016-12-22 11:04:44 +0000 | |
commit | d1dc8a2b73b1919ad7c87f5e2eb974b31733d7cc (patch) | |
tree | 13d3fbaa5b383022cc5b7e20c2b0ca23359d5fef /sys/netinet6 | |
parent | Use makefs to build bsd.rd; build & boot tested by mpi (diff) | |
download | wireguard-openbsd-d1dc8a2b73b1919ad7c87f5e2eb974b31733d7cc.tar.xz wireguard-openbsd-d1dc8a2b73b1919ad7c87f5e2eb974b31733d7cc.zip |
Remove PIM support from the multicast stack.
ok mpi@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/in6.h | 4 | ||||
-rw-r--r-- | sys/netinet6/in6_proto.c | 13 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 400 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.h | 3 | ||||
-rw-r--r-- | sys/netinet6/pim6.h | 69 | ||||
-rw-r--r-- | sys/netinet6/pim6_var.h | 71 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 3 |
7 files changed, 7 insertions, 556 deletions
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 524e836c43e..1a1278b7870 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.h,v 1.91 2016/10/03 12:33:21 mpi Exp $ */ +/* $OpenBSD: in6.h,v 1.92 2016/12/22 11:04:44 rzalamena Exp $ */ /* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */ /* @@ -511,7 +511,7 @@ ifatoia6(struct ifaddr *ifa) { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ - { "pim6", CTLTYPE_NODE }, \ + { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 8e78a604bb5..30fabede281 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_proto.c,v 1.86 2016/06/01 11:11:44 jca Exp $ */ +/* $OpenBSD: in6_proto.c,v 1.87 2016/12/22 11:04:44 rzalamena Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ /* @@ -91,10 +91,6 @@ #include <netinet/ip_esp.h> #include <netinet/ip_ipip.h> -#ifdef PIM -#include <netinet6/pim6_var.h> -#endif - #include <netinet6/in6_var.h> #include <netinet6/nd6.h> #include <netinet6/ip6protosw.h> @@ -218,13 +214,6 @@ struct ip6protosw inet6sw[] = { 0, 0, 0, 0, }, #endif /* GIF */ -#ifdef PIM -{ SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR, - pim6_input, rip6_output, 0, rip6_ctloutput, - rip6_usrreq, - 0, 0, 0, 0, pim6_sysctl -}, -#endif /* PIM */ #if NCARP > 0 { SOCK_RAW, &inet6domain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR, carp6_proto_input, rip6_output, 0, rip6_ctloutput, diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index e988aed79f5..ee60d887074 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -77,7 +77,7 @@ * Modified by Ajit Thyagarajan, PARC, August 1993 * Modified by Bill Fenner, PARC, April 1994 * - * MROUTING Revision: 3.5.1.2 + PIM-SMv2 (pimd) Support + * MROUTING Revision: 3.5.1.2 */ #include <sys/param.h> @@ -105,16 +105,6 @@ #include <netinet6/ip6_var.h> #include <netinet6/ip6_mroute.h> -#ifdef PIM -#include <netinet/pim.h> -#include <netinet6/pim6_var.h> - -int set_pim6(int *); -int get_pim6(struct mbuf *); -int socket6_send(struct socket *, struct mbuf *, struct sockaddr_in6 *); -int register_send(struct ip6_hdr *, struct mif6 *, struct mbuf *); -#endif - int ip6_mdq(struct mbuf *, struct ifnet *, struct mf6c *); void phyint_send6(struct ip6_hdr *, struct mif6 *, struct mbuf *); @@ -124,7 +114,7 @@ void phyint_send6(struct ip6_hdr *, struct mif6 *, struct mbuf *); */ struct socket *ip6_mrouter = NULL; int ip6_mrouter_ver = 0; -int ip6_mrtproto = IPPROTO_PIM; /* for netstat only */ +int ip6_mrtproto; /* for netstat only */ struct mrt6stat mrt6stat; #define NO_RTE_FOUND 0x1 @@ -151,11 +141,6 @@ static mifi_t nummifs = 0; static mifi_t reg_mif_num = (mifi_t)-1; unsigned int reg_mif_idx; -#ifdef PIM -struct pim6stat pim6stat; -static int pim6; -#endif - /* * Hash function for a source, group entry */ @@ -251,12 +236,6 @@ ip6_mrouter_set(int cmd, struct socket *so, struct mbuf *m) if (m == NULL || m->m_len < sizeof(struct mf6cctl)) return (EINVAL); return (del_m6fc(mtod(m, struct mf6cctl *))); -#ifdef PIM - case MRT6_PIM: - if (m == NULL || m->m_len < sizeof(int)) - return (EINVAL); - return (set_pim6(mtod(m, int *))); -#endif default: return (EOPNOTSUPP); } @@ -274,10 +253,6 @@ ip6_mrouter_get(int cmd, struct socket *so, struct mbuf **mp) *mp = m_get(M_WAIT, MT_SOOPTS); switch (cmd) { -#ifdef PIM - case MRT6_PIM: - return get_pim6(*mp); -#endif default: return EOPNOTSUPP; } @@ -439,34 +414,6 @@ mrt6_sysctl_mfc(void *oldp, size_t *oldlenp) return (0); } -#ifdef PIM -/* - * Get PIM processiong global - */ -int -get_pim6(struct mbuf *m) -{ - int *i; - - i = mtod(m, int *); - - *i = pim6; - - return 0; -} - -int -set_pim6(int *i) -{ - if ((*i != 1) && (*i != 0)) - return EINVAL; - - pim6 = *i; - - return 0; -} -#endif - /* * Enable multicast routing */ @@ -490,10 +437,6 @@ ip6_mrouter_init(struct socket *so, int v, int cmd) arc4random_buf(&mf6chashkey, sizeof(mf6chashkey)); bzero((caddr_t)n6expire, sizeof(n6expire)); -#ifdef PIM - pim6 = 0;/* used for stubbing out/in pim stuff */ -#endif - timeout_set(&expire_upcalls6_ch, expire_upcalls6, NULL); timeout_add(&expire_upcalls6_ch, EXPIRE_TIMEOUT); @@ -544,10 +487,6 @@ ip6_mrouter_done(void) bzero((caddr_t)mif6table, sizeof(mif6table)); nummifs = 0; -#ifdef PIM - pim6 = 0; /* used to stub out/in pim specific code */ -#endif - timeout_del(&expire_upcalls6_ch); /* @@ -629,27 +568,6 @@ add_m6if(struct mif6ctl *mifcp) if (mifp->m6_ifp) return EADDRINUSE; /* XXX: is it appropriate? */ -#ifdef PIM - if (mifcp->mif6c_flags & MIFF_REGISTER) { - if (reg_mif_num == (mifi_t)-1) { - ifp = malloc(sizeof(*ifp), M_DEVBUF, M_NOWAIT|M_ZERO); - if (ifp == NULL) - return (ENOMEM); - snprintf(ifp->if_xname, sizeof(ifp->if_xname), - "register_mif"); - ifp->if_flags |= IFF_LOOPBACK; - if_attach(ifp); - if_alloc_sadl(ifp); - - reg_mif_num = mifcp->mif6c_mifi; - reg_mif_idx = ifp->if_index; - mifcp->mif6c_pifi = ifp->if_index; - } - - ifp = if_get(reg_mif_idx); - KASSERT(ifp != NULL); - } else -#endif { ifp = if_get(mifcp->mif6c_pifi); if (ifp == NULL) @@ -1241,73 +1159,6 @@ ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c *rt) /* came in the wrong interface */ mrt6stat.mrt6s_wrong_if++; rt->mf6c_wrong_if++; -#ifdef PIM - /* - * If we are doing PIM processing, and we are forwarding - * packets on this interface, send a message to the - * routing daemon. - */ - /* have to make sure this is a valid mif */ - if (mifi < nummifs && mif6table[mifi].m6_ifp) { - mifi_t iif; - - if (pim6 && (m->m_flags & M_LOOP) == 0) { - /* - * Check the M_LOOP flag to avoid an - * unnecessary PIM assert. - * XXX: M_LOOP is an ad-hoc hack... - */ - struct sockaddr_in6 sin6; - - struct mbuf *mm; - struct mrt6msg *im; - - mm = m_copym(m, 0, sizeof(struct ip6_hdr), - M_NOWAIT); - if (mm && - (M_READONLY(mm) || - mm->m_len < sizeof(struct ip6_hdr))) - mm = m_pullup(mm, sizeof(struct ip6_hdr)); - if (mm == NULL) - return ENOBUFS; - - im = NULL; - switch (ip6_mrouter_ver) { - case MRT6_INIT: - im = mtod(mm, struct mrt6msg *); - im->im6_msgtype = MRT6MSG_WRONGMIF; - im->im6_mbz = 0; - break; - default: - m_freem(mm); - return EINVAL; - } - - for (mifp = mif6table, iif = 0; - iif < nummifs && mifp && - mifp->m6_ifp != ifp; - mifp++, iif++) - ; - - (void)memset(&sin6, 0, sizeof(sin6)); - sin6.sin6_len = sizeof(sin6); - sin6.sin6_family = AF_INET6; - switch (ip6_mrouter_ver) { - case MRT6_INIT: - im->im6_mif = iif; - sin6.sin6_addr = im->im6_src; - break; - } - - mrt6stat.mrt6s_upcalls++; - - if (socket6_send(ip6_mrouter, mm, &sin6) < 0) { - ++mrt6stat.mrt6s_upq_sockfull; - return ENOBUFS; - } - } - } -#endif /* PIM */ return 0; } /* if wrong iif */ @@ -1335,8 +1186,6 @@ ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c *rt) /* * check if the outgoing packet is going to break * a scope boundary. - * XXX For packets through PIM register tunnel - * interface, we believe a routing daemon. */ if ((mif6table[rt->mf6c_parent].m6_flags & MIFF_REGISTER) == 0 && @@ -1353,11 +1202,6 @@ ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c *rt) mifp->m6_pkt_out++; mifp->m6_bytes_out += plen; -#ifdef PIM - if (mifp->m6_flags & MIFF_REGISTER) - register_send(ip6, mifp, m); - else -#endif phyint_send6(ip6, mifp, m); } } @@ -1443,246 +1287,6 @@ phyint_send6(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m) splx(s); } -#ifdef PIM -int -register_send(struct ip6_hdr *ip6, struct mif6 *mif, struct mbuf *m) -{ - struct mbuf *mm; - int i, len = m->m_pkthdr.len; - struct sockaddr_in6 sin6; - struct mrt6msg *im6; - - ++pim6stat.pim6s_snd_registers; - - /* Make a copy of the packet to send to the user level process */ - MGETHDR(mm, M_DONTWAIT, MT_HEADER); - if (mm == NULL) - return ENOBUFS; - mm->m_data += max_linkhdr; - mm->m_len = sizeof(struct ip6_hdr); - - if ((mm->m_next = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { - m_freem(mm); - return ENOBUFS; - } - i = MHLEN - M_LEADINGSPACE(mm); - if (i > len) - i = len; - mm = m_pullup(mm, i); - if (mm == NULL) - return ENOBUFS; -/* TODO: check it! */ - mm->m_pkthdr.len = len + sizeof(struct ip6_hdr); - - /* - * Send message to routing daemon - */ - (void)memset(&sin6, 0, sizeof(sin6)); - sin6.sin6_len = sizeof(sin6); - sin6.sin6_family = AF_INET6; - sin6.sin6_addr = ip6->ip6_src; - - im6 = mtod(mm, struct mrt6msg *); - im6->im6_msgtype = MRT6MSG_WHOLEPKT; - im6->im6_mbz = 0; - - im6->im6_mif = mif - mif6table; - - /* iif info is not given for reg. encap.n */ - mrt6stat.mrt6s_upcalls++; - - if (socket6_send(ip6_mrouter, mm, &sin6) < 0) { - ++mrt6stat.mrt6s_upq_sockfull; - return ENOBUFS; - } - return 0; -} - -/* - * PIM sparse mode hook - * Receives the pim control messages, and passes them up to the listening - * socket, using rip6_input. - * The only message processed is the REGISTER pim message; the pim header - * is stripped off, and the inner packet is passed to register_mforward. - */ -int -pim6_input(struct mbuf **mp, int *offp, int proto) -{ - struct pim *pim; /* pointer to a pim struct */ - struct ip6_hdr *ip6; - int pimlen; - struct mbuf *m = *mp; - int minlen; - int off = *offp; - - ++pim6stat.pim6s_rcv_total; - - ip6 = mtod(m, struct ip6_hdr *); - pimlen = m->m_pkthdr.len - *offp; - - /* - * Validate lengths - */ - if (pimlen < PIM_MINLEN) { - ++pim6stat.pim6s_rcv_tooshort; - m_freem(m); - return (IPPROTO_DONE); - } - - /* - * if the packet is at least as big as a REGISTER, go ahead - * and grab the PIM REGISTER header size, to avoid another - * possible m_pullup() later. - * - * PIM_MINLEN == pimhdr + u_int32 == 8 - * PIM6_REG_MINLEN == pimhdr + reghdr + eip6hdr == 4 + 4 + 40 - */ - minlen = (pimlen >= PIM6_REG_MINLEN) ? PIM6_REG_MINLEN : PIM_MINLEN; - - /* - * Make sure that the IP6 and PIM headers in contiguous memory, and - * possibly the PIM REGISTER header - */ - IP6_EXTHDR_GET(pim, struct pim *, m, off, minlen); - if (pim == NULL) { - pim6stat.pim6s_rcv_tooshort++; - return IPPROTO_DONE; - } - - /* PIM version check */ - if (pim->pim_ver != PIM_VERSION) { - ++pim6stat.pim6s_rcv_badversion; - m_freem(m); - return (IPPROTO_DONE); - } - -#define PIM6_CHECKSUM -#ifdef PIM6_CHECKSUM - { - int cksumlen; - - /* - * Validate checksum. - * If PIM REGISTER, exclude the data packet - */ - if (pim->pim_type == PIM_REGISTER) - cksumlen = PIM_MINLEN; - else - cksumlen = pimlen; - - if (in6_cksum(m, IPPROTO_PIM, off, cksumlen)) { - ++pim6stat.pim6s_rcv_badsum; - m_freem(m); - return (IPPROTO_DONE); - } - } -#endif /* PIM_CHECKSUM */ - - if (pim->pim_type == PIM_REGISTER) { - /* - * since this is a REGISTER, we'll make a copy of the register - * headers ip6+pim+u_int32_t+encap_ip6, to be passed up to the - * routing daemon. - */ - static struct sockaddr_in6 dst = { sizeof(dst), AF_INET6 }; - - struct mbuf *mcp; - struct ip6_hdr *eip6; - u_int32_t *reghdr; - - ++pim6stat.pim6s_rcv_registers; - - if ((reg_mif_num >= nummifs) || (reg_mif_num == (mifi_t) -1)) { - m_freem(m); - return (IPPROTO_DONE); - } - - reghdr = (u_int32_t *)(pim + 1); - - if ((ntohl(*reghdr) & PIM_NULL_REGISTER)) - goto pim6_input_to_daemon; - - /* - * Validate length - */ - if (pimlen < PIM6_REG_MINLEN) { - ++pim6stat.pim6s_rcv_tooshort; - ++pim6stat.pim6s_rcv_badregisters; - m_freem(m); - return (IPPROTO_DONE); - } - - eip6 = (struct ip6_hdr *) (reghdr + 1); - /* verify the version number of the inner packet */ - if ((eip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { - ++pim6stat.pim6s_rcv_badregisters; - m_freem(m); - return (IPPROTO_NONE); - } - - /* verify the inner packet is destined to a mcast group */ - if (!IN6_IS_ADDR_MULTICAST(&eip6->ip6_dst)) { - ++pim6stat.pim6s_rcv_badregisters; - m_freem(m); - return (IPPROTO_DONE); - } - - /* - * make a copy of the whole header to pass to the daemon later. - */ - mcp = m_copym(m, 0, off + PIM6_REG_MINLEN, M_NOWAIT); - if (mcp == NULL) { - m_freem(m); - return (IPPROTO_DONE); - } - - /* - * forward the inner ip6 packet; point m_data at the inner ip6. - */ - m_adj(m, off + PIM_MINLEN); - if_input_local(mif6table[reg_mif_num].m6_ifp, m, - dst.sin6_family); - - /* prepare the register head to send to the mrouting daemon */ - m = mcp; - } - - /* - * Pass the PIM message up to the daemon; if it is a register message - * pass the 'head' only up to the daemon. This includes the - * encapsulator ip6 header, pim header, register header and the - * encapsulated ip6 header. - */ - pim6_input_to_daemon: - rip6_input(&m, offp, proto); - return (IPPROTO_DONE); -} - -/* - * Sysctl for pim6 variables. - */ -int -pim6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) -{ - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return (ENOTDIR); - - switch (name[0]) { - case PIM6CTL_STATS: - if (newp != NULL) - return (EPERM); - return (sysctl_struct(oldp, oldlenp, newp, newlen, - &pim6stat, sizeof(pim6stat))); - - default: - return (ENOPROTOOPT); - } - /* NOTREACHED */ -} -#endif /* PIM */ - u_int32_t _mf6chash(const struct in6_addr *a, const struct in6_addr *g) { diff --git a/sys/netinet6/ip6_mroute.h b/sys/netinet6/ip6_mroute.h index 5062d08ce13..5b1d7df7f50 100644 --- a/sys/netinet6/ip6_mroute.h +++ b/sys/netinet6/ip6_mroute.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_mroute.h,v 1.16 2015/06/08 22:19:28 krw Exp $ */ +/* $OpenBSD: ip6_mroute.h,v 1.17 2016/12/22 11:04:44 rzalamena Exp $ */ /* $KAME: ip6_mroute.h,v 1.17 2001/02/10 02:05:52 itojun Exp $ */ /* @@ -53,7 +53,6 @@ #define MRT6_DEL_MIF 103 /* delete multicast interface */ #define MRT6_ADD_MFC 104 /* insert forwarding cache entry */ #define MRT6_DEL_MFC 105 /* delete forwarding cache entry */ -#define MRT6_PIM 107 /* enable pim code */ #define MRT6_INIT 108 /* initialize forwarder (mrt6msg) */ /* diff --git a/sys/netinet6/pim6.h b/sys/netinet6/pim6.h deleted file mode 100644 index c5581977ce5..00000000000 --- a/sys/netinet6/pim6.h +++ /dev/null @@ -1,69 +0,0 @@ -/* $OpenBSD: pim6.h,v 1.4 2013/10/21 10:05:18 deraadt Exp $ */ -/* $KAME: pim6.h,v 1.3 2000/03/25 07:23:58 sumikawa Exp $ */ - -/* - * Copyright (C) 1998 WIDE Project. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -/* - * Protocol Independent Multicast (PIM) definitions - * - * Written by Ahmed Helmy, SGI, July 1996 - * - * MULTICAST - */ - -/* - * PIM packet header - */ -#define PIM_VERSION 2 -struct pim { -#if _BYTE_ORDER == LITTLE_ENDIAN - u_int pim_type:4, /* the PIM message type, currently they are: - * Hello, Register, Register-Stop, Join/Prune, - * Bootstrap, Assert, Graft (PIM-DM only), - * Graft-Ack (PIM-DM only), C-RP-Adv - */ - pim_ver:4; /* PIM version number; 2 for PIMv2 */ -#else - u_int pim_ver:4, /* PIM version */ - pim_type:4; /* PIM type */ -#endif - u_char pim_rsv; /* Reserved */ - u_short pim_cksum; /* IP style check sum */ -}; - -#define PIM_MINLEN 8 /* The header min. length is 8 */ -#define PIM6_REG_MINLEN (PIM_MINLEN+40) /* Register message + inner IP6 header */ - -/* - * Message types - */ -#define PIM_REGISTER 1 /* PIM Register type is 1 */ - -/* second bit in reg_head is the null bit */ -#define PIM_NULL_REGISTER 0x40000000 diff --git a/sys/netinet6/pim6_var.h b/sys/netinet6/pim6_var.h deleted file mode 100644 index 9df921325f8..00000000000 --- a/sys/netinet6/pim6_var.h +++ /dev/null @@ -1,71 +0,0 @@ -/* $OpenBSD: pim6_var.h,v 1.11 2013/10/24 11:47:33 deraadt Exp $ */ -/* $KAME: pim6_var.h,v 1.8 2000/06/06 08:07:43 jinmei Exp $ */ - -/* - * Copyright (C) 1998 WIDE Project. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _NETINET6_PIM6_VAR_H_ -#define _NETINET6_PIM6_VAR_H_ - -/* - * Protocol Independent Multicast (PIM), - * implementation-specific definitions. - * - * Written by George Edmond Eddy (Rusty), ISI, February 1998 - * Modified by Pavlin Ivanov Radoslavov, USC/ISI, May 1998 - */ - -struct pim6stat { - u_int64_t pim6s_rcv_total; /* total PIM messages received */ - u_int64_t pim6s_rcv_tooshort; /* received with too few bytes */ - u_int64_t pim6s_rcv_badsum; /* received with bad checksum */ - u_int64_t pim6s_rcv_badversion; /* received bad PIM version */ - u_int64_t pim6s_rcv_registers; /* received registers */ - u_int64_t pim6s_rcv_badregisters; /* received invalid registers */ - u_int64_t pim6s_snd_registers; /* sent registers */ -}; - -/* - * Names for PIM6 sysctl objects - */ -#define PIM6CTL_STATS 1 /* PIM6 stats */ -#define PIM6CTL_MAXID 2 - -#define PIM6CTL_NAMES { \ - { 0, 0 }, \ - { "stats", CTLTYPE_NODE }, \ -} - -#ifdef _KERNEL -extern struct pim6stat pim6stat; -int pim6_input(struct mbuf **, int *, int); -int pim6_sysctl(int *, u_int, void *, size_t *, void *, size_t); -#endif /* _KERNEL */ - -#endif /* _NETINET6_PIM6_VAR_H_ */ diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 8445d7827d1..58cb0e34ab7 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.100 2016/12/19 08:36:50 mpi Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.101 2016/12/22 11:04:44 rzalamena Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -528,7 +528,6 @@ rip6_ctloutput(int op, struct socket *so, int level, int optname, case MRT6_DEL_MIF: case MRT6_ADD_MFC: case MRT6_DEL_MFC: - case MRT6_PIM: if (op == PRCO_SETOPT) { error = ip6_mrouter_set(optname, so, *mp); if (*mp) |