Skip to content
Commit 1c51a915 authored by Stephen Hemminger's avatar Stephen Hemminger
Browse files

vxlan: fix race caused by dropping rtnl_unlock



It is possible for two cpu's to race creating vxlan device.
For most cases this is harmless, but the ability to assign "next
avaliable vxlan device" relies on rtnl lock being held across the
whole operation. Therfore two instances of calling:
  ip li add vxlan%d vxlan ...
could collide and create two devices with same name.

To fix this defer creation of socket to a work queue, and
handle possible races there. Introduce a lock to ensure that
changes to vxlan socket hash list is SMP safe.

Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
parent 8385f50a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment