diff options
author | bz <bz@FreeBSD.org> | 2008-08-17 23:27:27 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2008-08-17 23:27:27 +0000 |
commit | 1021d43b569bfc8d2c5544bde2f540fa432b011f (patch) | |
tree | 1496da534aec03cf2f9d2d0735d80e4c1e3b5715 /sys/netinet6/route6.c | |
parent | 7fc341305a3e341fca7f202fc1219358f8d9dbbd (diff) | |
download | FreeBSD-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/netinet6/route6.c')
-rw-r--r-- | sys/netinet6/route6.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/netinet6/route6.c b/sys/netinet6/route6.c index e607bea..c058f3b 100644 --- a/sys/netinet6/route6.c +++ b/sys/netinet6/route6.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include <sys/socket.h> #include <sys/systm.h> #include <sys/queue.h> +#include <sys/vimage.h> #include <net/if.h> @@ -74,7 +75,7 @@ route6_input(struct mbuf **mp, int *offp, int proto) if (ip6a) { /* XXX reject home-address option before rthdr */ if (ip6a->ip6a_flags & IP6A_SWAP) { - ip6stat.ip6s_badoptions++; + V_ip6stat.ip6s_badoptions++; m_freem(m); return IPPROTO_DONE; } @@ -88,7 +89,7 @@ route6_input(struct mbuf **mp, int *offp, int proto) ip6 = mtod(m, struct ip6_hdr *); IP6_EXTHDR_GET(rh, struct ip6_rthdr *, m, off, sizeof(*rh)); if (rh == NULL) { - ip6stat.ip6s_tooshort++; + V_ip6stat.ip6s_tooshort++; return IPPROTO_DONE; } #endif @@ -115,7 +116,7 @@ route6_input(struct mbuf **mp, int *offp, int proto) */ IP6_EXTHDR_GET(rh, struct ip6_rthdr *, m, off, rhlen); if (rh == NULL) { - ip6stat.ip6s_tooshort++; + V_ip6stat.ip6s_tooshort++; return IPPROTO_DONE; } #endif @@ -129,7 +130,7 @@ route6_input(struct mbuf **mp, int *offp, int proto) rhlen = (rh->ip6r_len + 1) << 3; break; /* Final dst. Just ignore the header. */ } - ip6stat.ip6s_badoptions++; + V_ip6stat.ip6s_badoptions++; icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, (caddr_t)&rh->ip6r_type - (caddr_t)ip6); return (IPPROTO_DONE); @@ -166,14 +167,14 @@ ip6_rthdr0(struct mbuf *m, struct ip6_hdr *ip6, struct ip6_rthdr0 *rh0) * RFC 2462: this limitation was removed since strict/loose * bitmap field was deleted. */ - ip6stat.ip6s_badoptions++; + V_ip6stat.ip6s_badoptions++; icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, (caddr_t)&rh0->ip6r0_len - (caddr_t)ip6); return (-1); } if ((addrs = rh0->ip6r0_len / 2) < rh0->ip6r0_segleft) { - ip6stat.ip6s_badoptions++; + V_ip6stat.ip6s_badoptions++; icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, (caddr_t)&rh0->ip6r0_segleft - (caddr_t)ip6); return (-1); @@ -192,7 +193,7 @@ ip6_rthdr0(struct mbuf *m, struct ip6_hdr *ip6, struct ip6_rthdr0 *rh0) IN6_IS_ADDR_UNSPECIFIED(nextaddr) || IN6_IS_ADDR_V4MAPPED(nextaddr) || IN6_IS_ADDR_V4COMPAT(nextaddr)) { - ip6stat.ip6s_badoptions++; + V_ip6stat.ip6s_badoptions++; m_freem(m); return (-1); } @@ -200,7 +201,7 @@ ip6_rthdr0(struct mbuf *m, struct ip6_hdr *ip6, struct ip6_rthdr0 *rh0) IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst) || IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst) || IN6_IS_ADDR_V4COMPAT(&ip6->ip6_dst)) { - ip6stat.ip6s_badoptions++; + V_ip6stat.ip6s_badoptions++; m_freem(m); return (-1); } @@ -213,7 +214,7 @@ ip6_rthdr0(struct mbuf *m, struct ip6_hdr *ip6, struct ip6_rthdr0 *rh0) if ((ifa = ip6_getdstifaddr(m)) == NULL) goto bad; if (in6_setscope(nextaddr, ifa->ia_ifp, NULL) != 0) { - ip6stat.ip6s_badscope++; + V_ip6stat.ip6s_badscope++; goto bad; } |