summaryrefslogtreecommitdiffstats
path: root/sys/netipx/ipx_input.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-01-09 05:00:41 +0000
committerrwatson <rwatson@FreeBSD.org>2005-01-09 05:00:41 +0000
commita6ab698ab0edb8e7baa3a6a732e387823f1c3dcd (patch)
tree4fd6402fc00deda5073cdd5d8a3074dacec8f007 /sys/netipx/ipx_input.c
parentdbe7c51df6abf448367f1b6dd6785e0cc8b5815b (diff)
downloadFreeBSD-src-a6ab698ab0edb8e7baa3a6a732e387823f1c3dcd.zip
FreeBSD-src-a6ab698ab0edb8e7baa3a6a732e387823f1c3dcd.tar.gz
Introduce a global mutex, ipxpcb_list_mtx, to protect the global
IPX PCB lists. Add macros to initialize, destroy, lock, unlock, and assert the mutex. Initialize the mutex when IPX is started. Add per-IPX PCB mutexes, ipxp_mtx in struct ipxpcb, to protect per-PCB IPX/SPX state. Add macros to initialize, destroy, lock, unlock, and assert the mutex. Initialize the mutex when a new PCB is allocated; destroy it when the PCB is free'd. MFC after: 2 weeks
Diffstat (limited to 'sys/netipx/ipx_input.c')
-rw-r--r--sys/netipx/ipx_input.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c
index 596b275..0e8f75e 100644
--- a/sys/netipx/ipx_input.c
+++ b/sys/netipx/ipx_input.c
@@ -88,6 +88,7 @@ struct sockaddr_ipx ipx_netmask, ipx_hostmask;
/*
* IPX protocol control block (pcb) lists.
*/
+struct mtx ipxpcb_list_mtx;
struct ipxpcbhead ipxpcb_list;
struct ipxpcbhead ipxrawpcb_list;
@@ -114,6 +115,8 @@ ipx_init()
LIST_INIT(&ipxpcb_list);
LIST_INIT(&ipxrawpcb_list);
+ IPX_LIST_LOCK_INIT();
+
ipx_netmask.sipx_len = 6;
ipx_netmask.sipx_addr.x_net = ipx_broadnet;
OpenPOWER on IntegriCloud