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.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 9341cf2..88c1e61 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -185,19 +185,8 @@ void
rip_init(void)
{
- INP_INFO_LOCK_INIT(&V_ripcbinfo, "rip");
- LIST_INIT(&V_ripcb);
-#ifdef VIMAGE
- V_ripcbinfo.ipi_vnet = curvnet;
-#endif
- V_ripcbinfo.ipi_listhead = &V_ripcb;
- V_ripcbinfo.ipi_hashbase =
- hashinit(INP_PCBHASH_RAW_SIZE, M_PCB, &V_ripcbinfo.ipi_hashmask);
- V_ripcbinfo.ipi_porthashbase =
- hashinit(1, M_PCB, &V_ripcbinfo.ipi_porthashmask);
- V_ripcbinfo.ipi_zone = uma_zcreate("ripcb", sizeof(struct inpcb),
- NULL, NULL, rip_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
- uma_zone_set_max(V_ripcbinfo.ipi_zone, maxsockets);
+ in_pcbinfo_init(&V_ripcbinfo, "rip", &V_ripcb, INP_PCBHASH_RAW_SIZE,
+ 1, "ripcb", rip_inpcb_init, NULL, UMA_ZONE_NOFREE);
EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change, NULL,
EVENTHANDLER_PRI_ANY);
}
@@ -207,10 +196,7 @@ void
rip_destroy(void)
{
- hashdestroy(V_ripcbinfo.ipi_hashbase, M_PCB,
- V_ripcbinfo.ipi_hashmask);
- hashdestroy(V_ripcbinfo.ipi_porthashbase, M_PCB,
- V_ripcbinfo.ipi_porthashmask);
+ in_pcbinfo_destroy(&V_ripcbinfo);
}
#endif
OpenPOWER on IntegriCloud