diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-02-16 22:31:31 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-02-16 22:31:31 +0000 |
commit | 7289f371a0b113c12add274c4d4aa84d0c147dee (patch) | |
tree | caaadea3c6dff299367b9079558141efc2f1ea65 /sys/src/9/ip/pktmedium.c | |
parent | 755880b19f365c3f98eac5c7de1d8b25f773ace3 (diff) |
devip: dont hold ifc wlock during medium bind/unbind
Wlock()'ing the ifc causes a deadlock with Medium
bind/unbind as the routine can walk /net, while
ndb/dns or ndb/cs are currently blocked enumerating
/net/ipifc/*.
The fix is to have a fake medium, called "unbound",
that is set temporarily during the call of Medium
bind and unbind.
That way, the interface rwlock can be released while
bind/unbind is in progress.
The ipifcunbind() routine will refuse to unbind a
ifc that is currently assigned to the "unbound"
medium, preventing any accidents.
Diffstat (limited to 'sys/src/9/ip/pktmedium.c')
-rw-r--r-- | sys/src/9/ip/pktmedium.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/sys/src/9/ip/pktmedium.c b/sys/src/9/ip/pktmedium.c index 15ac6405a..633ba66b2 100644 --- a/sys/src/9/ip/pktmedium.c +++ b/sys/src/9/ip/pktmedium.c @@ -29,7 +29,6 @@ Medium pktmedium = /* * called to bind an IP ifc to an packet device - * called with ifc wlock'd */ static void pktbind(Ipifc*, int argc, char **argv) @@ -37,9 +36,6 @@ pktbind(Ipifc*, int argc, char **argv) USED(argc, argv); } -/* - * called with ifc wlock'd - */ static void pktunbind(Ipifc*) { |