koko icon indicating copy to clipboard operation
koko copied to clipboard

Add temp interface name for vxlan

Open networkop opened this issue 5 years ago • 0 comments

Hi Tomofumi, it's me again. I've been using your library for quite a while now and occasionally I run into a race condition when two Vxlan links are created with the same name at the same time. Like this:

  1. First vxlan link is created using MakeVxLan call for container c1, it's interface name is eth1
  2. Before the first call gets to the SetVethLink, another vxlan links is created for container c2 but with the same name eth1.
  3. Obviously the netlink.LinkAdd(&vxlanconf) fails for the second call with vxlan add failed: Failed to add vxlan eth1: file exists

I was wondering, would it be possible to do a similar trick that you do with veth pair, namely give it a temporary name and rename it only after it's been moved to the container's namespace?

networkop avatar Nov 27 '18 17:11 networkop