Skip to content

Commit 90a6b89

Browse files
committed
lint: ipn/wg
1 parent 47ae7e5 commit 90a6b89

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

intra/ipn/wg/wgconn.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,7 @@ func (s *StdNetBind) flood(c net.PacketConn, dst StdNetEndpoint, why floodkind)
466466
hdr[0] = mlist[mrand.UintN(uint(len(mlist)))]
467467
_, _ = rand.Read(hdr[6:14])
468468

469-
tot := mrand.Uint64N(maxFloodPkts + 1)
470-
if tot < minFloodPkts {
471-
tot = minFloodPkts
472-
}
469+
tot := max(mrand.Uint64N(maxFloodPkts+1), minFloodPkts)
473470
// go.dev/play/p/NkLihAUTqUO
474471
maxWaitMs := maxFloodDuration.Milliseconds() / int64(tot)
475472
expectedsent := make([]int, tot)

intra/ipn/wgproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ func (t *wgtun) setRoutes(ifaddrs []netip.Prefix) error {
866866
}
867867
t.hasV4.Store(t.hasV4.Load() || ip.Is4())
868868
t.hasV6.Store(t.hasV6.Load() || ip.Is6())
869-
log.D("proxy: wg: %s added ifaddr(%v)", t.id, ip)
869+
log.D("proxy: wg: %s added ifaddr(%v)", t.id, ap)
870870
}
871871
if t.hasV4.Load() {
872872
t.stack.AddRoute(tcpip.Route{Destination: header.IPv4EmptySubnet, NIC: wgnic})

0 commit comments

Comments
 (0)