summaryrefslogtreecommitdiff
path: root/sys/src/cmd/ip
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2022-02-26 22:05:32 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2022-02-26 22:05:32 +0000
commit9944e16b16ab7eaa517a2c1eacffb2b936f51e45 (patch)
treed5c9f075c6893ae7b08588e0531f0be3d7a7d18c /sys/src/cmd/ip
parentbe0a80faf3bb94c4e2a8fba2d6b38a931e030f72 (diff)
devbridge: improve locking, unbind ports automatically on read error and more...
Use an RWlock so readers can work in parallel in the common case (no cache updates). When a reader needs to update the cache to add a new learned source mac address, it will drop the rlock and aquire the wlock to do the update. When we get a read error, we now unbind the port to avoid further packets being forwarded to it. This is usefull for hotplug ethernet devices like usb ones or tunnels. Simplify the unbind, getting rid of the refcount, by having only the reader proc call freeport(). Avoid holding the bridge lock while opening and closing ethernet/tunnel device files during bind and unbind. Dont use smalloc() (especially when holding locks). Allocate bridges dynamically, so we do not waste the memory when we do not need them. Reject non-hostowner from allocating new bridges. Use consistent naming: port -> port Use consistent comment style: // -> /* */
Diffstat (limited to 'sys/src/cmd/ip')
0 files changed, 0 insertions, 0 deletions