aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2004-10-19 21:35:42 +0000
committerRobert Watson <rwatson@FreeBSD.org>2004-10-19 21:35:42 +0000
commit279128e295c75eea4b7a396e35adcb63f7e0a556 (patch)
tree015594621a34155e21c0c594a60906579d56e550 /sys/netinet/ip_divert.c
parent72584fd2c0708d9f7b879e916aeb99d63c911287 (diff)
downloadsrc-279128e295c75eea4b7a396e35adcb63f7e0a556.tar.gz
src-279128e295c75eea4b7a396e35adcb63f7e0a556.zip
Annotate a newly introduced race present due to the unloading of
protocols: it is possible for sockets to be created and attached to the divert protocol between the test for sockets present and successful unload of the registration handler. We will need to explore more mature APIs for unregistering the protocol and then draining consumers, or an atomic test-and-unregister mechanism.
Notes
Notes: svn path=/head/; revision=136715
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r--sys/netinet/ip_divert.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index f2fa212b5ea3..b2161cff363d 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -693,6 +693,10 @@ div_modevent(module_t mod, int type, void *unused)
* Module ipdivert can only be unloaded if no sockets are
* connected. Maybe this can be changed later to forcefully
* disconnect any open sockets.
+ *
+ * XXXRW: Note that there is a slight race here, as a socket
+ * could be opened between when we test and when we
+ * unregister.
*/
INP_INFO_RLOCK(&divcbinfo);
n = divcbinfo.ipi_count;