Skip to content

Commit

Permalink
debug : wireguard kernel support function
Browse files Browse the repository at this point in the history
  • Loading branch information
kunsonx committed Nov 26, 2023
1 parent 4154985 commit 775cf80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions infra/conf/wireguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ func (c *WireGuardConfig) Build() (proto.Message, error) {
return nil, newError("unsupported domain strategy: ", c.DomainStrategy)
}

// check device exist for wireguard setup

config.IsClient = c.IsClient
if c.IsClient {
if support := wireguard.KernelTunSupported(); c.KernelMode == nil {
Expand Down
4 changes: 1 addition & 3 deletions proxy/wireguard/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ func New(ctx context.Context, conf *DeviceConfig) (*Handler, error) {
func (h *Handler) processWireGuard(dialer internet.Dialer) (err error) {
h.wgLock.Lock()
defer h.wgLock.Unlock()

fmt.Printf("processWireGuard net: %v, dialer: %v, net: %v\n", h.net, dialer, h.net)

if h.bind != nil && h.bind.dialer == dialer && h.net != nil {
return nil
}
Expand Down Expand Up @@ -144,6 +141,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
}

if err := h.processWireGuard(dialer); err != nil {
fmt.Printf("processWireGuard err: %v\n", err)
return err
}

Expand Down

0 comments on commit 775cf80

Please sign in to comment.