summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r--sys/netinet/ip_divert.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 80b001ab64b4..86ec9fce84c7 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip_divert.h>
#include <netinet/ip_var.h>
#include <netinet/ip_fw.h>
-#include <netinet/vinet.h>
#ifdef SCTP
#include <netinet/sctp_crc32.h>
#endif
@@ -117,10 +116,11 @@ __FBSDID("$FreeBSD$");
*/
/* Internal variables. */
-#ifdef VIMAGE_GLOBALS
-static struct inpcbhead divcb;
-static struct inpcbinfo divcbinfo;
-#endif
+static VNET_DEFINE(struct inpcbhead, divcb);
+static VNET_DEFINE(struct inpcbinfo, divcbinfo);
+
+#define V_divcb VNET_GET(divcb)
+#define V_divcbinfo VNET_GET(divcbinfo)
static u_long div_sendspace = DIVSNDQ; /* XXX sysctl ? */
static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */
@@ -131,7 +131,6 @@ static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */
static void
div_zone_change(void *tag)
{
- INIT_VNET_INET(curvnet);
uma_zone_set_max(V_divcbinfo.ipi_zone, maxsockets);
}
@@ -156,7 +155,6 @@ div_inpcb_fini(void *mem, int size)
void
div_init(void)
{
- INIT_VNET_INET(curvnet);
INP_INFO_LOCK_INIT(&V_divcbinfo, "div");
LIST_INIT(&V_divcb);
@@ -187,7 +185,6 @@ div_init(void)
void
div_input(struct mbuf *m, int off)
{
- INIT_VNET_INET(curvnet);
IPSTAT_INC(ips_noproto);
m_freem(m);
@@ -202,7 +199,6 @@ div_input(struct mbuf *m, int off)
static void
divert_packet(struct mbuf *m, int incoming)
{
- INIT_VNET_INET(curvnet);
struct ip *ip;
struct inpcb *inp;
struct socket *sa;
@@ -330,7 +326,6 @@ static int
div_output(struct socket *so, struct mbuf *m, struct sockaddr_in *sin,
struct mbuf *control)
{
- INIT_VNET_INET(curvnet);
struct m_tag *mtag;
struct divert_tag *dt;
int error = 0;
@@ -483,7 +478,6 @@ cantsend:
static int
div_attach(struct socket *so, int proto, struct thread *td)
{
- INIT_VNET_INET(so->so_vnet);
struct inpcb *inp;
int error;
@@ -515,7 +509,6 @@ div_attach(struct socket *so, int proto, struct thread *td)
static void
div_detach(struct socket *so)
{
- INIT_VNET_INET(so->so_vnet);
struct inpcb *inp;
inp = sotoinpcb(so);
@@ -530,7 +523,6 @@ div_detach(struct socket *so)
static int
div_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
{
- INIT_VNET_INET(so->so_vnet);
struct inpcb *inp;
int error;
@@ -571,7 +563,6 @@ static int
div_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
struct mbuf *control, struct thread *td)
{
- INIT_VNET_INET(so->so_vnet);
/* Packet must have a header (but that's about it) */
if (m->m_len < sizeof (struct ip) &&
@@ -600,7 +591,6 @@ div_ctlinput(int cmd, struct sockaddr *sa, void *vip)
static int
div_pcblist(SYSCTL_HANDLER_ARGS)
{
- INIT_VNET_INET(curvnet);
int error, i, n;
struct inpcb *inp, **inp_list;
inp_gen_t gencnt;
@@ -725,7 +715,6 @@ struct protosw div_protosw = {
static int
div_modevent(module_t mod, int type, void *unused)
{
- INIT_VNET_INET(curvnet); /* XXX move to iattach - revisit!!! */
int err = 0;
int n;