diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-03-22 16:04:43 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-03-22 16:04:43 +0000 |
commit | aaf338640edc5b97817ed043864912e3193b5c72 (patch) | |
tree | 57de7b111e737beb9dc79a5c406c2c378993a50d /sys/net/if_gre.h | |
parent | 2f3c5b96fbd42a5b2ad28a77e6cb4ceaa6d76832 (diff) | |
download | FreeBSD-src-aaf338640edc5b97817ed043864912e3193b5c72.zip FreeBSD-src-aaf338640edc5b97817ed043864912e3193b5c72.tar.gz |
Lock down global variables in if_gre:
- Add gre_mtx to protect global softc list.
- Hold gre_mtx over various list operations (insert, delete).
- Centralize if_gre interface teardown in gre_destroy(), and call this
from modevent unload and gre_clone_destroy().
- Export gre_mtx to ip_gre.c, which walks the gre list to look up gre
interfaces during encapsulation. Add a wonking comment on how we need
some sort of drain/reference count mechanism to keep gre references
alive while in use and simultaneous destroy.
This commit does not lockdown softc data, which follows in a future
commit.
Diffstat (limited to 'sys/net/if_gre.h')
-rw-r--r-- | sys/net/if_gre.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if_gre.h b/sys/net/if_gre.h index 21fab39..2910f2f 100644 --- a/sys/net/if_gre.h +++ b/sys/net/if_gre.h @@ -176,6 +176,7 @@ struct mobip_h { #ifdef _KERNEL LIST_HEAD(gre_softc_head, gre_softc); +extern struct mtx gre_mtx; extern struct gre_softc_head gre_softc_list; u_int16_t gre_in_cksum(u_int16_t *, u_int); |