Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/wireguard/resources/allocator_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (a *Allocator) AllocateIPNet() (net.IPNet, error) {

// AllocatePort provides available UDP port for the wireguard endpoint.
func (a *Allocator) AllocatePort() (int, error) {
p, err := a.ports.Acquire()
p, err := a.portSupplier.Acquire()
return int(p), err
}

Expand Down
9 changes: 2 additions & 7 deletions services/wireguard/service/service_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,10 @@ func NewManager(
natService nat.NATService,
portMap func(port int) (releasePortMapping func()),
options Options,
portPool portSupplier,
portSupplier portSupplier,
) *Manager {

portSupplier := portPool
if options.PortMin != 0 {
portSupplier = port.NewFixed(options.PortMin)
}

resourceAllocator := resources.NewAllocator(portSupplier, options.MaxConnections, options.Subnet)
resourceAllocator := resources.NewAllocator(portSupplier, options.Subnet)
return &Manager{
natService: natService,
resourceAllocator: resourceAllocator,
Expand Down