summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_mroute.c
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2008-10-02 15:37:58 +0000
committerzec <zec@FreeBSD.org>2008-10-02 15:37:58 +0000
commit8797d4caecd5881e312923ee1d07be3de68755dc (patch)
tree53fef93d1ff076abec439159e0a765427992dee1 /sys/netinet/ip_mroute.c
parente682bfadb0a191a81290af2b846d8610ef3aff5c (diff)
downloadFreeBSD-src-8797d4caecd5881e312923ee1d07be3de68755dc.zip
FreeBSD-src-8797d4caecd5881e312923ee1d07be3de68755dc.tar.gz
Step 1.5 of importing the network stack virtualization infrastructure
from the vimage project, as per plan established at devsummit 08/08: http://wiki.freebsd.org/Image/Notes200808DevSummit Introduce INIT_VNET_*() initializer macros, VNET_FOREACH() iterator macros, and CURVNET_SET() context setting macros, all currently resolving to NOPs. Prepare for virtualization of selected SYSCTL objects by introducing a family of SYSCTL_V_*() macros, currently resolving to their global counterparts, i.e. SYSCTL_V_INT() == SYSCTL_INT(). Move selected #defines from sys/sys/vimage.h to newly introduced header files specific to virtualized subsystems (sys/net/vnet.h, sys/netinet/vinet.h etc.). All the changes are verified to have zero functional impact at this point in time by doing MD5 comparision between pre- and post-change object files(*). (*) netipsec/keysock.c did not validate depending on compile time options. Implemented by: julian, bz, brooks, zec Reviewed by: julian, bz, brooks, kris, rwatson, ... Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
Diffstat (limited to 'sys/netinet/ip_mroute.c')
-rw-r--r--sys/netinet/ip_mroute.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 730f0af..a241ec4 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -422,6 +422,7 @@ mfc_find(in_addr_t o, in_addr_t g)
static int
X_ip_mrouter_set(struct socket *so, struct sockopt *sopt)
{
+ INIT_VNET_INET(curvnet);
int error, optval;
vifi_t vifi;
struct vifctl vifc;
@@ -646,6 +647,7 @@ ip_mrouter_reset(void)
static void
if_detached_event(void *arg __unused, struct ifnet *ifp)
{
+ INIT_VNET_INET(curvnet);
vifi_t vifi;
int i;
struct mfc *mfc;
@@ -709,6 +711,8 @@ if_detached_event(void *arg __unused, struct ifnet *ifp)
static int
ip_mrouter_init(struct socket *so, int version)
{
+ INIT_VNET_INET(curvnet);
+
if (mrtdebug)
log(LOG_DEBUG, "ip_mrouter_init: so_type = %d, pr_protocol = %d\n",
so->so_type, so->so_proto->pr_protocol);
@@ -755,6 +759,7 @@ ip_mrouter_init(struct socket *so, int version)
static int
X_ip_mrouter_done(void)
{
+ INIT_VNET_INET(curvnet);
vifi_t vifi;
int i;
struct ifnet *ifp;
@@ -1286,6 +1291,7 @@ static int
X_ip_mforward(struct ip *ip, struct ifnet *ifp, struct mbuf *m,
struct ip_moptions *imo)
{
+ INIT_VNET_INET(curvnet);
struct mfc *rt;
int error;
vifi_t vifi;
@@ -1590,6 +1596,7 @@ expire_upcalls(void *unused)
static int
ip_mdq(struct mbuf *m, struct ifnet *ifp, struct mfc *rt, vifi_t xmt_vif)
{
+ INIT_VNET_INET(curvnet);
struct ip *ip = mtod(m, struct ip *);
vifi_t vifi;
int plen = ip->ip_len;
@@ -1801,6 +1808,7 @@ send_packet(struct vif *vifp, struct mbuf *m)
static int
X_ip_rsvp_vif(struct socket *so, struct sockopt *sopt)
{
+ INIT_VNET_INET(curvnet);
int error, vifi;
if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP)
@@ -1855,6 +1863,7 @@ X_ip_rsvp_vif(struct socket *so, struct sockopt *sopt)
static void
X_ip_rsvp_force_done(struct socket *so)
{
+ INIT_VNET_INET(curvnet);
int vifi;
/* Don't bother if it is not the right type of socket. */
@@ -1885,6 +1894,7 @@ X_ip_rsvp_force_done(struct socket *so)
static void
X_rsvp_input(struct mbuf *m, int off)
{
+ INIT_VNET_INET(curvnet);
int vifi;
struct ip *ip = mtod(m, struct ip *);
struct sockaddr_in rsvp_src = { sizeof rsvp_src, AF_INET };
@@ -2286,6 +2296,7 @@ bw_meter_prepare_upcall(struct bw_meter *x, struct timeval *nowp)
static void
bw_upcalls_send(void)
{
+ INIT_VNET_INET(curvnet);
struct mbuf *m;
int len = bw_upcalls_n * sizeof(bw_upcalls[0]);
struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET };
@@ -2646,6 +2657,7 @@ static int
pim_register_send_upcall(struct ip *ip, struct vif *vifp,
struct mbuf *mb_copy, struct mfc *rt)
{
+ INIT_VNET_INET(curvnet);
struct mbuf *mb_first;
int len = ntohs(ip->ip_len);
struct igmpmsg *im;
@@ -2700,6 +2712,7 @@ static int
pim_register_send_rp(struct ip *ip, struct vif *vifp, struct mbuf *mb_copy,
struct mfc *rt)
{
+ INIT_VNET_INET(curvnet);
struct mbuf *mb_first;
struct ip *ip_outer;
struct pim_encap_pimhdr *pimhdr;
@@ -3029,6 +3042,8 @@ pim_input_to_daemon:
static int
ip_mroute_modevent(module_t mod, int type, void *unused)
{
+ INIT_VNET_INET(curvnet);
+
switch (type) {
case MOD_LOAD:
MROUTER_LOCK_INIT();
OpenPOWER on IntegriCloud