diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2008-06-26 23:05:28 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2008-06-26 23:05:28 +0000 |
commit | 02f4879d3ac31fe03976a006123b9c2c33e05f4f (patch) | |
tree | 1a406ca586e36376a4f6fc527aef4c5964c174b5 /tools/regression | |
parent | a54eadd8c4f117d1a367f618dcc0440b303cb338 (diff) | |
download | src-02f4879d3ac31fe03976a006123b9c2c33e05f4f.tar.gz src-02f4879d3ac31fe03976a006123b9c2c33e05f4f.zip |
Introduce locking around use of ifindex_table, whose use was previously
unsynchronized. While races were extremely rare, we've now had a
couple of reports of panics in environments involving large numbers of
IPSEC tunnels being added very quickly on an active system.
- Add accessor functions ifnet_byindex(), ifaddr_byindex(),
ifdev_byindex() to replace existing accessor macros. These functions
now acquire the ifnet lock before derefencing the table.
- Add IFNET_WLOCK_ASSERT().
- Add static accessor functions ifnet_setbyindex(), ifdev_setbyindex(),
which set values in the table either asserting of acquiring the ifnet
lock.
- Use accessor functions throughout if.c to modify and read
ifindex_table.
- Rework ifnet attach/detach to lock around ifindex_table modification.
Note that these changes simply close races around use of ifindex_table,
and make no attempt to solve the probem of disappearing ifnets. Further
refinement of this work, including with respect to ifindex_table
resizing, is still required.
In a future change, the ifnet lock should be converted from a mutex to an
rwlock in order to reduce contention.
Reviewed and tested by: brooks
Notes
Notes:
svn path=/head/; revision=180042
Diffstat (limited to 'tools/regression')
0 files changed, 0 insertions, 0 deletions