summaryrefslogtreecommitdiffstats
path: root/sys/netinet/raw_ip.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r--sys/netinet/raw_ip.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 00ec423..c3a0a74 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -68,18 +68,17 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip_var.h>
#include <netinet/ip_mroute.h>
-#include <netinet/vinet.h>
-
#ifdef IPSEC
#include <netipsec/ipsec.h>
#endif /*IPSEC*/
#include <security/mac/mac_framework.h>
-#ifdef VIMAGE_GLOBALS
-struct inpcbhead ripcb;
-struct inpcbinfo ripcbinfo;
-#endif
+VNET_DEFINE(struct inpcbhead, ripcb);
+VNET_DEFINE(struct inpcbinfo, ripcbinfo);
+
+#define V_ripcb VNET_GET(ripcb)
+#define V_ripcbinfo VNET_GET(ripcbinfo)
/*
* Control and data hooks for ipfw and dummynet.
@@ -99,9 +98,7 @@ int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa) = NULL;
/*
* The socket used to communicate with the multicast routing daemon.
*/
-#ifdef VIMAGE_GLOBALS
-struct socket *ip_mrouter;
-#endif
+VNET_DEFINE(struct socket *, ip_mrouter);
/*
* The various mrouter and rsvp functions.
@@ -168,7 +165,6 @@ rip_delhash(struct inpcb *inp)
static void
rip_zone_change(void *tag)
{
- INIT_VNET_INET(curvnet);
uma_zone_set_max(V_ripcbinfo.ipi_zone, maxsockets);
}
@@ -185,7 +181,6 @@ rip_inpcb_init(void *mem, int size, int flags)
void
rip_init(void)
{
- INIT_VNET_INET(curvnet);
INP_INFO_LOCK_INIT(&V_ripcbinfo, "rip");
LIST_INIT(&V_ripcb);
@@ -208,7 +203,6 @@ rip_init(void)
void
rip_destroy(void)
{
- INIT_VNET_INET(curvnet);
hashdestroy(V_ripcbinfo.ipi_hashbase, M_PCB,
V_ripcbinfo.ipi_hashmask);
@@ -268,7 +262,6 @@ rip_append(struct inpcb *last, struct ip *ip, struct mbuf *n,
void
rip_input(struct mbuf *m, int off)
{
- INIT_VNET_INET(curvnet);
struct ifnet *ifp;
struct ip *ip = mtod(m, struct ip *);
int proto = ip->ip_p;
@@ -398,7 +391,6 @@ rip_input(struct mbuf *m, int off)
int
rip_output(struct mbuf *m, struct socket *so, u_long dst)
{
- INIT_VNET_INET(so->so_vnet);
struct ip *ip;
int error;
struct inpcb *inp = sotoinpcb(so);
@@ -670,7 +662,6 @@ rip_ctloutput(struct socket *so, struct sockopt *sopt)
void
rip_ctlinput(int cmd, struct sockaddr *sa, void *vip)
{
- INIT_VNET_INET(curvnet);
struct in_ifaddr *ia;
struct ifnet *ifp;
int err;
@@ -741,7 +732,6 @@ SYSCTL_ULONG(_net_inet_raw, OID_AUTO, recvspace, CTLFLAG_RW,
static int
rip_attach(struct socket *so, int proto, struct thread *td)
{
- INIT_VNET_INET(so->so_vnet);
struct inpcb *inp;
int error;
@@ -775,7 +765,6 @@ rip_attach(struct socket *so, int proto, struct thread *td)
static void
rip_detach(struct socket *so)
{
- INIT_VNET_INET(so->so_vnet);
struct inpcb *inp;
inp = sotoinpcb(so);
@@ -815,7 +804,6 @@ rip_dodisconnect(struct socket *so, struct inpcb *inp)
static void
rip_abort(struct socket *so)
{
- INIT_VNET_INET(so->so_vnet);
struct inpcb *inp;
inp = sotoinpcb(so);
@@ -831,7 +819,6 @@ rip_abort(struct socket *so)
static void
rip_close(struct socket *so)
{
- INIT_VNET_INET(so->so_vnet);
struct inpcb *inp;
inp = sotoinpcb(so);
@@ -847,7 +834,6 @@ rip_close(struct socket *so)
static int
rip_disconnect(struct socket *so)
{
- INIT_VNET_INET(so->so_vnet);
struct inpcb *inp;
if ((so->so_state & SS_ISCONNECTED) == 0)
@@ -867,8 +853,6 @@ rip_disconnect(struct socket *so)
static int
rip_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
{
- INIT_VNET_NET(so->so_vnet);
- INIT_VNET_INET(so->so_vnet);
struct sockaddr_in *addr = (struct sockaddr_in *)nam;
struct inpcb *inp;
int error;
@@ -903,8 +887,6 @@ rip_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
static int
rip_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
{
- INIT_VNET_NET(so->so_vnet);
- INIT_VNET_INET(so->so_vnet);
struct sockaddr_in *addr = (struct sockaddr_in *)nam;
struct inpcb *inp;
@@ -975,7 +957,6 @@ rip_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
static int
rip_pcblist(SYSCTL_HANDLER_ARGS)
{
- INIT_VNET_INET(curvnet);
int error, i, n;
struct inpcb *inp, **inp_list;
inp_gen_t gencnt;
OpenPOWER on IntegriCloud