Skip to content

Commit

Permalink
Fix race condition ending in empty routes
Browse files Browse the repository at this point in the history
  • Loading branch information
NHAS committed Jun 11, 2023
1 parent 8cc6935 commit 7b4ddea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/router/bpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ type fwDevice struct {
}

func GetRoutes(username string) ([]string, error) {

lock.RLock()
defer lock.RUnlock()

userid := sha1.Sum([]byte(username))

result := map[string]bool{}
Expand Down

0 comments on commit 7b4ddea

Please sign in to comment.