diff options
author | bms <bms@FreeBSD.org> | 2007-02-24 11:38:47 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2007-02-24 11:38:47 +0000 |
commit | 3e83ac665326a6a015b2179fc28157d9fb7433e2 (patch) | |
tree | 6230b66dd7bf83f11724dee78961a7c0020c9d31 /sys/netinet6/raw_ip6.c | |
parent | c553ec0508d385c07a87aed036312de1e3a64b03 (diff) | |
download | FreeBSD-src-3e83ac665326a6a015b2179fc28157d9fb7433e2.zip FreeBSD-src-3e83ac665326a6a015b2179fc28157d9fb7433e2.tar.gz |
Make IPv6 multicast forwarding dynamically loadable from a GENERIC kernel.
It is built in the same module as IPv4 multicast forwarding, i.e. ip_mroute.ko,
if and only if IPv6 support is enabled for loadable modules.
Export IPv6 forwarding structs to userland netstat(1) via sysctl(9).
Diffstat (limited to 'sys/netinet6/raw_ip6.c')
-rw-r--r-- | sys/netinet6/raw_ip6.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index cab78eb..643c694 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -122,6 +122,18 @@ extern u_long rip_recvspace; struct rip6stat rip6stat; /* + * Hooks for multicast forwarding. + */ + +struct socket *ip6_mrouter; + +int (*ip6_mrouter_set)(struct socket *, struct sockopt *); +int (*ip6_mrouter_get)(struct socket *, struct sockopt *); +int (*ip6_mrouter_done)(void); +int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, struct mbuf *); +int (*mrt6_ioctl)(int, caddr_t); + +/* * Setup generic address and protocol structures * for raw_input routine, then pass them along with * mbuf chain. @@ -507,7 +519,8 @@ rip6_ctloutput(so, sopt) case MRT6_ADD_MFC: case MRT6_DEL_MFC: case MRT6_PIM: - error = ip6_mrouter_get(so, sopt); + error = ip6_mrouter_get ? ip6_mrouter_get(so, sopt) : + EOPNOTSUPP; break; case IPV6_CHECKSUM: error = ip6_raw_ctloutput(so, sopt); @@ -527,7 +540,8 @@ rip6_ctloutput(so, sopt) case MRT6_ADD_MFC: case MRT6_DEL_MFC: case MRT6_PIM: - error = ip6_mrouter_set(so, sopt); + error = ip6_mrouter_set ? ip6_mrouter_set(so, sopt) : + EOPNOTSUPP; break; case IPV6_CHECKSUM: error = ip6_raw_ctloutput(so, sopt); @@ -587,9 +601,9 @@ rip6_detach(struct socket *so) inp = sotoinpcb(so); KASSERT(inp != NULL, ("rip6_detach: inp == NULL")); - /* xxx: RSVP */ - if (so == ip6_mrouter) + if (so == ip6_mrouter && ip6_mrouter_done) ip6_mrouter_done(); + /* xxx: RSVP */ INP_INFO_WLOCK(&ripcbinfo); INP_LOCK(inp); if (inp->in6p_icmp6filt) { |