Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added global lock to linux wg quick, fixed race condition when 2 wg interfaces wanted to have the same table number #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrew-aladjev
Copy link

@andrew-aladjev andrew-aladjev commented Apr 23, 2024

Added global lock to linux wg quick, fixed race condition when 2 wg interfaces wanted to have the same table number.

If it will be accepted than the next step will be to separate adding default route and adding firewall rules.

What issue has been fixed:

  1. You are creating multiple wg interfaces and starting them in parallel.
  2. All wg interfaces is trying to use table number 51820.
  3. The first wg interface succeeds, other interfaces fail.

What is the problem in wg quick? It is not globaly locking calculation of next table number.
How to fix it? We need to add global flock.

…nterfaces wanted to have the same table number. 1. You are creating multiple wg interfaces and starting them in parallel. 2. All wg interfaces is trying to use table number 51820. 3. The first wg interface succeeds, other interfaces fail. What is the problem in wg quick? It is not globaly locking calculation of next table number. How to fix it? We need to add global flock.

Signed-off-by: Andrew Aladjev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant