Deleted Added
full compact
ip6_mroute.c (261710) ip6_mroute.c (269699)
1/*-
2 * Copyright (C) 1998 WIDE Project.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 65 unchanged lines hidden (view full) ---

74 * Modified by Van Jacobson, LBL, January 1993
75 * Modified by Ajit Thyagarajan, PARC, August 1993
76 * Modified by Bill Fenner, PARC, April 1994
77 *
78 * MROUTING Revision: 3.5.1.2 + PIM-SMv2 (pimd) Support
79 */
80
81#include <sys/cdefs.h>
1/*-
2 * Copyright (C) 1998 WIDE Project.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 65 unchanged lines hidden (view full) ---

74 * Modified by Van Jacobson, LBL, January 1993
75 * Modified by Ajit Thyagarajan, PARC, August 1993
76 * Modified by Bill Fenner, PARC, April 1994
77 *
78 * MROUTING Revision: 3.5.1.2 + PIM-SMv2 (pimd) Support
79 */
80
81#include <sys/cdefs.h>
82__FBSDID("$FreeBSD: head/sys/netinet6/ip6_mroute.c 261710 2014-02-10 14:47:51Z brueffer $");
82__FBSDID("$FreeBSD: head/sys/netinet6/ip6_mroute.c 269699 2014-08-08 01:57:15Z kevlo $");
83
84#include "opt_inet6.h"
85
86#include <sys/param.h>
87#include <sys/callout.h>
88#include <sys/errno.h>
89#include <sys/kernel.h>
90#include <sys/lock.h>

--- 25 unchanged lines hidden (view full) ---

116#include <netinet/ip_encap.h>
117
118#include <netinet/ip6.h>
119#include <netinet/in_kdtrace.h>
120#include <netinet6/ip6_var.h>
121#include <netinet6/scope6_var.h>
122#include <netinet6/nd6.h>
123#include <netinet6/ip6_mroute.h>
83
84#include "opt_inet6.h"
85
86#include <sys/param.h>
87#include <sys/callout.h>
88#include <sys/errno.h>
89#include <sys/kernel.h>
90#include <sys/lock.h>

--- 25 unchanged lines hidden (view full) ---

116#include <netinet/ip_encap.h>
117
118#include <netinet/ip6.h>
119#include <netinet/in_kdtrace.h>
120#include <netinet6/ip6_var.h>
121#include <netinet6/scope6_var.h>
122#include <netinet6/nd6.h>
123#include <netinet6/ip6_mroute.h>
124#include <netinet6/ip6protosw.h>
125#include <netinet6/pim6.h>
126#include <netinet6/pim6_var.h>
127
128static MALLOC_DEFINE(M_MRTABLE6, "mf6c", "multicast forwarding cache entry");
129
130/* XXX: this is a very common idiom; move to <sys/mbuf.h> ? */
131#define M_HASCL(m) ((m)->m_flags & M_EXT)
132
133static int ip6_mdq(struct mbuf *, struct ifnet *, struct mf6c *);
134static void phyint_send(struct ip6_hdr *, struct mif6 *, struct mbuf *);
135static int register_send(struct ip6_hdr *, struct mif6 *, struct mbuf *);
136static int set_pim6(int *);
137static int socket_send(struct socket *, struct mbuf *,
138 struct sockaddr_in6 *);
139
140extern int in6_mcast_loop;
141extern struct domain inet6domain;
142
143static const struct encaptab *pim6_encap_cookie;
124#include <netinet6/pim6.h>
125#include <netinet6/pim6_var.h>
126
127static MALLOC_DEFINE(M_MRTABLE6, "mf6c", "multicast forwarding cache entry");
128
129/* XXX: this is a very common idiom; move to <sys/mbuf.h> ? */
130#define M_HASCL(m) ((m)->m_flags & M_EXT)
131
132static int ip6_mdq(struct mbuf *, struct ifnet *, struct mf6c *);
133static void phyint_send(struct ip6_hdr *, struct mif6 *, struct mbuf *);
134static int register_send(struct ip6_hdr *, struct mif6 *, struct mbuf *);
135static int set_pim6(int *);
136static int socket_send(struct socket *, struct mbuf *,
137 struct sockaddr_in6 *);
138
139extern int in6_mcast_loop;
140extern struct domain inet6domain;
141
142static const struct encaptab *pim6_encap_cookie;
144static const struct ip6protosw in6_pim_protosw = {
143static const struct protosw in6_pim_protosw = {
145 .pr_type = SOCK_RAW,
146 .pr_domain = &inet6domain,
147 .pr_protocol = IPPROTO_PIM,
148 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
149 .pr_input = pim6_input,
144 .pr_type = SOCK_RAW,
145 .pr_domain = &inet6domain,
146 .pr_protocol = IPPROTO_PIM,
147 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR,
148 .pr_input = pim6_input,
150 .pr_output = rip6_output,
149 .pr_output = (pr_output_t *)rip6_output,
151 .pr_ctloutput = rip6_ctloutput,
152 .pr_usrreqs = &rip6_usrreqs
153};
154static int pim6_encapcheck(const struct mbuf *, int, int, void *);
155
156static VNET_DEFINE(int, ip6_mrouter_ver) = 0;
157#define V_ip6_mrouter_ver VNET(ip6_mrouter_ver)
158

--- 1797 unchanged lines hidden ---
150 .pr_ctloutput = rip6_ctloutput,
151 .pr_usrreqs = &rip6_usrreqs
152};
153static int pim6_encapcheck(const struct mbuf *, int, int, void *);
154
155static VNET_DEFINE(int, ip6_mrouter_ver) = 0;
156#define V_ip6_mrouter_ver VNET(ip6_mrouter_ver)
157

--- 1797 unchanged lines hidden ---