aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_loop.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2008-08-17 23:27:27 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2008-08-17 23:27:27 +0000
commit603724d3abed34351087e20b8cb363d8e02072c1 (patch)
tree1496da534aec03cf2f9d2d0735d80e4c1e3b5715 /sys/net/if_loop.c
parentac2dcb729fc5b54bc829c23d239dec65a057bf49 (diff)
downloadsrc-603724d3abed34351087e20b8cb363d8e02072c1.tar.gz
src-603724d3abed34351087e20b8cb363d8e02072c1.zip
Commit step 1 of the vimage project, (network stack)
virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch
Notes
Notes: svn path=/head/; revision=181803
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r--sys/net/if_loop.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index ea41517c0111..eebae0c87944 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -49,6 +49,7 @@
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
+#include <sys/vimage.h>
#include <net/if.h>
#include <net/if_clone.h>
@@ -104,7 +105,7 @@ lo_clone_destroy(struct ifnet *ifp)
{
/* XXX: destroying lo0 will lead to panics. */
- KASSERT(loif != ifp, ("%s: destroying lo0", __func__));
+ KASSERT(V_loif != ifp, ("%s: destroying lo0", __func__));
bpfdetach(ifp);
if_detach(ifp);
@@ -128,8 +129,8 @@ lo_clone_create(struct if_clone *ifc, int unit, caddr_t params)
ifp->if_snd.ifq_maxlen = ifqmaxlen;
if_attach(ifp);
bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
- if (loif == NULL)
- loif = ifp;
+ if (V_loif == NULL)
+ V_loif = ifp;
return (0);
}
@@ -234,15 +235,15 @@ if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen)
bpf_mtap(ifp->if_bpf, m);
}
} else {
- if (bpf_peers_present(loif->if_bpf)) {
- if ((m->m_flags & M_MCAST) == 0 || loif == ifp) {
+ if (bpf_peers_present(V_loif->if_bpf)) {
+ if ((m->m_flags & M_MCAST) == 0 || V_loif == ifp) {
/* XXX beware sizeof(af) != 4 */
u_int32_t af1 = af;
/*
* We need to prepend the address family.
*/
- bpf_mtap2(loif->if_bpf, &af1, sizeof(af1), m);
+ bpf_mtap2(V_loif->if_bpf, &af1, sizeof(af1), m);
}
}
}