summaryrefslogtreecommitdiffstats
path: root/sys/netipsec/ipsec_mbuf.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-08-17 23:27:27 +0000
committerbz <bz@FreeBSD.org>2008-08-17 23:27:27 +0000
commit1021d43b569bfc8d2c5544bde2f540fa432b011f (patch)
tree1496da534aec03cf2f9d2d0735d80e4c1e3b5715 /sys/netipsec/ipsec_mbuf.c
parent7fc341305a3e341fca7f202fc1219358f8d9dbbd (diff)
downloadFreeBSD-src-1021d43b569bfc8d2c5544bde2f540fa432b011f.zip
FreeBSD-src-1021d43b569bfc8d2c5544bde2f540fa432b011f.tar.gz
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
Diffstat (limited to 'sys/netipsec/ipsec_mbuf.c')
-rw-r--r--sys/netipsec/ipsec_mbuf.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/netipsec/ipsec_mbuf.c b/sys/netipsec/ipsec_mbuf.c
index d4ec42a..79c1928 100644
--- a/sys/netipsec/ipsec_mbuf.c
+++ b/sys/netipsec/ipsec_mbuf.c
@@ -36,6 +36,7 @@
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
+#include <sys/vimage.h>
#include <net/route.h>
#include <netinet/in.h>
@@ -88,7 +89,7 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off)
return (NULL);
n->m_next = m->m_next; /* splice new mbuf */
m->m_next = n;
- ipsec4stat.ips_mbinserted++;
+ V_ipsec4stat.ips_mbinserted++;
if (hlen <= M_TRAILINGSPACE(m) + remain) {
/*
* New header fits in the old mbuf if we copy
@@ -122,7 +123,7 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off)
/* splice in second mbuf */
n2->m_next = n->m_next;
n->m_next = n2;
- ipsec4stat.ips_mbinserted++;
+ V_ipsec4stat.ips_mbinserted++;
} else {
memcpy(mtod(n, caddr_t) + hlen,
mtod(m, caddr_t) + skip, remain);
@@ -238,7 +239,7 @@ m_striphdr(struct mbuf *m, int skip, int hlen)
/* Remove the header and associated data from the mbuf. */
if (roff == 0) {
/* The header was at the beginning of the mbuf */
- ipsec4stat.ips_input_front++;
+ V_ipsec4stat.ips_input_front++;
m_adj(m1, hlen);
if ((m1->m_flags & M_PKTHDR) == 0)
m->m_pkthdr.len -= hlen;
@@ -250,7 +251,7 @@ m_striphdr(struct mbuf *m, int skip, int hlen)
* so first let's remove the remainder of the header from
* the beginning of the remainder of the mbuf chain, if any.
*/
- ipsec4stat.ips_input_end++;
+ V_ipsec4stat.ips_input_end++;
if (roff + hlen > m1->m_len) {
/* Adjust the next mbuf by the remainder */
m_adj(m1->m_next, roff + hlen - m1->m_len);
@@ -275,7 +276,7 @@ m_striphdr(struct mbuf *m, int skip, int hlen)
* The header lies in the "middle" of the mbuf; copy
* the remainder of the mbuf down over the header.
*/
- ipsec4stat.ips_input_middle++;
+ V_ipsec4stat.ips_input_middle++;
bcopy(mtod(m1, u_char *) + roff + hlen,
mtod(m1, u_char *) + roff,
m1->m_len - (roff + hlen));
OpenPOWER on IntegriCloud