summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_src.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/netinet6/in6_src.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/netinet6/in6_src.c')
-rw-r--r--sys/netinet6/in6_src.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 7a0d7d1..cb2ad89 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -174,6 +174,7 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
struct inpcb *inp, struct route_in6 *ro, struct ucred *cred,
struct ifnet **ifpp, int *errorp)
{
+ INIT_VNET_INET6(curvnet);
struct in6_addr dst;
struct ifnet *ifp = NULL;
struct in6_ifaddr *ia = NULL, *ia_best = NULL;
@@ -456,6 +457,8 @@ selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
struct ifnet **retifp, struct rtentry **retrt, int clone,
int norouteok)
{
+ INIT_VNET_NET(curvnet);
+ INIT_VNET_INET6(curvnet);
int error = 0;
struct ifnet *ifp = NULL;
struct rtentry *rt = NULL;
@@ -735,6 +738,7 @@ in6_selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
int
in6_selecthlim(struct in6pcb *in6p, struct ifnet *ifp)
{
+ INIT_VNET_INET6(curvnet);
if (in6p && in6p->in6p_hops >= 0)
return (in6p->in6p_hops);
@@ -767,6 +771,7 @@ in6_selecthlim(struct in6pcb *in6p, struct ifnet *ifp)
int
in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred)
{
+ INIT_VNET_INET(curvnet);
struct socket *so = inp->inp_socket;
u_int16_t lport = 0, first, last, *lastport;
int count, error = 0, wild = 0;
@@ -863,6 +868,7 @@ addrsel_policy_init(void)
{
ADDRSEL_LOCK_INIT();
ADDRSEL_SXLOCK_INIT();
+ INIT_VNET_INET6(curvnet);
init_policy_queue();
@@ -874,6 +880,7 @@ addrsel_policy_init(void)
static struct in6_addrpolicy *
lookup_addrsel_policy(struct sockaddr_in6 *key)
{
+ INIT_VNET_INET6(curvnet);
struct in6_addrpolicy *match = NULL;
ADDRSEL_LOCK();
@@ -965,6 +972,7 @@ struct addrsel_policyhead addrsel_policytab;
static void
init_policy_queue(void)
{
+ INIT_VNET_INET6(curvnet);
TAILQ_INIT(&V_addrsel_policytab);
}
@@ -972,6 +980,7 @@ init_policy_queue(void)
static int
add_addrsel_policyent(struct in6_addrpolicy *newpolicy)
{
+ INIT_VNET_INET6(curvnet);
struct addrsel_policyent *new, *pol;
MALLOC(new, struct addrsel_policyent *, sizeof(*new), M_IFADDR,
@@ -1007,6 +1016,7 @@ add_addrsel_policyent(struct in6_addrpolicy *newpolicy)
static int
delete_addrsel_policyent(struct in6_addrpolicy *key)
{
+ INIT_VNET_INET6(curvnet);
struct addrsel_policyent *pol;
ADDRSEL_XLOCK();
@@ -1038,6 +1048,7 @@ static int
walk_addrsel_policy(int (*callback)(struct in6_addrpolicy *, void *),
void *w)
{
+ INIT_VNET_INET6(curvnet);
struct addrsel_policyent *pol;
int error = 0;
@@ -1066,6 +1077,7 @@ dump_addrsel_policyent(struct in6_addrpolicy *pol, void *arg)
static struct in6_addrpolicy *
match_addrsel_policy(struct sockaddr_in6 *key)
{
+ INIT_VNET_INET6(curvnet);
struct addrsel_policyent *pent;
struct in6_addrpolicy *bestpol = NULL, *pol;
int matchlen, bestmatchlen = -1;
OpenPOWER on IntegriCloud