diff options
author | zec <zec@FreeBSD.org> | 2008-10-02 15:37:58 +0000 |
---|---|---|
committer | zec <zec@FreeBSD.org> | 2008-10-02 15:37:58 +0000 |
commit | 8797d4caecd5881e312923ee1d07be3de68755dc (patch) | |
tree | 53fef93d1ff076abec439159e0a765427992dee1 /sys/netinet6/nd6_rtr.c | |
parent | e682bfadb0a191a81290af2b846d8610ef3aff5c (diff) | |
download | FreeBSD-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/netinet6/nd6_rtr.c')
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 3eb49bd..a1f891b 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -119,6 +119,7 @@ int ip6_temp_regen_advance = TEMPADDR_REGEN_ADVANCE; void nd6_rs_input(struct mbuf *m, int off, int icmp6len) { + INIT_VNET_INET6(curvnet); struct ifnet *ifp = m->m_pkthdr.rcvif; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); struct nd_router_solicit *nd_rs; @@ -203,6 +204,7 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) void nd6_ra_input(struct mbuf *m, int off, int icmp6len) { + INIT_VNET_INET6(curvnet); struct ifnet *ifp = m->m_pkthdr.rcvif; struct nd_ifinfo *ndi = ND_IFINFO(ifp); struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); @@ -483,6 +485,7 @@ defrouter_addreq(struct nd_defrouter *new) struct nd_defrouter * defrouter_lookup(struct in6_addr *addr, struct ifnet *ifp) { + INIT_VNET_INET6(ifp->if_vnet); struct nd_defrouter *dr; for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; @@ -531,6 +534,7 @@ defrouter_delreq(struct nd_defrouter *dr) void defrouter_reset(void) { + INIT_VNET_INET6(curvnet); struct nd_defrouter *dr; for (dr = TAILQ_FIRST(&V_nd_defrouter); dr; @@ -546,6 +550,7 @@ defrouter_reset(void) void defrtrlist_del(struct nd_defrouter *dr) { + INIT_VNET_INET6(curvnet); struct nd_defrouter *deldr = NULL; struct nd_prefix *pr; @@ -607,6 +612,7 @@ defrtrlist_del(struct nd_defrouter *dr) void defrouter_select(void) { + INIT_VNET_INET6(curvnet); int s = splnet(); struct nd_defrouter *dr, *selected_dr = NULL, *installed_dr = NULL; struct rtentry *rt = NULL; @@ -723,6 +729,7 @@ rtpref(struct nd_defrouter *dr) static struct nd_defrouter * defrtrlist_update(struct nd_defrouter *new) { + INIT_VNET_INET6(curvnet); struct nd_defrouter *dr, *n; int s = splnet(); @@ -844,6 +851,7 @@ pfxrtr_del(struct nd_pfxrouter *pfr) struct nd_prefix * nd6_prefix_lookup(struct nd_prefixctl *key) { + INIT_VNET_INET6(curvnet); struct nd_prefix *search; for (search = V_nd_prefix.lh_first; @@ -863,6 +871,7 @@ int nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr, struct nd_prefix **newp) { + INIT_VNET_INET6(curvnet); struct nd_prefix *new = NULL; int error = 0; int i, s; @@ -921,6 +930,7 @@ nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr, void prelist_remove(struct nd_prefix *pr) { + INIT_VNET_INET6(curvnet); struct nd_pfxrouter *pfr, *next; int e, s; char ip6buf[INET6_ADDRSTRLEN]; @@ -973,6 +983,7 @@ static int prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, struct mbuf *m, int mcast) { + INIT_VNET_INET6(curvnet); struct in6_ifaddr *ia6 = NULL, *ia6_match = NULL; struct ifaddr *ifa; struct ifnet *ifp = new->ndpr_ifp; @@ -1343,6 +1354,7 @@ find_pfxlist_reachable_router(struct nd_prefix *pr) void pfxlist_onlink_check() { + INIT_VNET_INET6(curvnet); struct nd_prefix *pr; struct in6_ifaddr *ifa; struct nd_defrouter *dr; @@ -1522,6 +1534,7 @@ pfxlist_onlink_check() int nd6_prefix_onlink(struct nd_prefix *pr) { + INIT_VNET_INET6(curvnet); struct ifaddr *ifa; struct ifnet *ifp = pr->ndpr_ifp; struct sockaddr_in6 mask6; @@ -1635,6 +1648,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) int nd6_prefix_offlink(struct nd_prefix *pr) { + INIT_VNET_INET6(curvnet); int error = 0; struct ifnet *ifp = pr->ndpr_ifp; struct nd_prefix *opr; @@ -1726,6 +1740,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) static struct in6_ifaddr * in6_ifadd(struct nd_prefixctl *pr, int mcast) { + INIT_VNET_INET6(curvnet); struct ifnet *ifp = pr->ndpr_ifp; struct ifaddr *ifa; struct in6_aliasreq ifra; @@ -1854,6 +1869,7 @@ in6_ifadd(struct nd_prefixctl *pr, int mcast) int in6_tmpifadd(const struct in6_ifaddr *ia0, int forcegen, int delay) { + INIT_VNET_INET6(curvnet); struct ifnet *ifp = ia0->ia_ifa.ifa_ifp; struct in6_ifaddr *newia, *ia; struct in6_aliasreq ifra; @@ -2021,7 +2037,7 @@ in6_init_address_ltimes(struct nd_prefix *new, struct in6_addrlifetime *lt6) void rt6_flush(struct in6_addr *gateway, struct ifnet *ifp) { - + INIT_VNET_NET(curvnet); struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; int s = splnet(); @@ -2074,6 +2090,8 @@ rt6_deleteroute(struct radix_node *rn, void *arg) int nd6_setdefaultiface(int ifindex) { + INIT_VNET_NET(curvnet); + INIT_VNET_INET6(curvnet); int error = 0; if (ifindex < 0 || V_if_index < ifindex) |