Skip to content

Commit

Permalink
vet: unused var, fns in wgconn
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Nov 17, 2024
1 parent f87b287 commit 04ffd41
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions intra/ipn/wg/wgconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (

const maxbindtries = 50
const wgtimeout = 60 * time.Second
const useWarpClientID = true

// github.com/WireGuard/wireguard-go/blob/19ac233cc6/wireguard/device/send.go#L96
var (
Expand All @@ -55,7 +54,6 @@ var (
/*11-15*/ 0x00, 0x00, 0x00, 0x00, // fieldNonce
/*16-17*/ 0x44, 0xD0, // ???
}
reservedZeros = []byte{0x00, 0x00, 0x00}
)

const (
Expand Down Expand Up @@ -475,19 +473,6 @@ func (s *StdNetBind) flood(c *net.UDPConn, dst netip.AddrPort, why floodkind) (i
})
}

func isReservedOverwitten(b []byte) bool {
if !useWarpClientID {
return false
}

if n := len(b); n == 3 { // client-id
return b[0] != 0 || b[1] != 0 || b[2] != 0
} else if n > 3 { // wg message
return b[1] != 0 || b[2] != 0 || b[3] != 0
}
return false
}

func (s *StdNetBind) BatchSize() int {
return 1
}
Expand Down

2 comments on commit 04ffd41

@ignoramous
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ignoramous
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.