Skip to content

Commit dfb696c

Browse files
committed
ipn/wg: m ip4/ip6 ifaddr info in mtu logs
1 parent 1c8b55d commit dfb696c

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

intra/ipn/wgproxy.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,33 +1520,35 @@ func (w *wgproxy) maybeResetMtu(via Proxy, dryrun bool) error {
15201520
}
15211521
}
15221522

1523+
has4 := w.IP4()
1524+
has6 := w.IP6()
15231525
minmtu := minmtu4
1524-
if has6 := w.IP6(); has6 {
1526+
if has6 {
15251527
minmtu = minmtu6
15261528
}
15271529
if hopping && mtuNeededByUs > mtuAvailable {
1528-
note("wg: %s proxy: maybe hopping %t %s; mtu(needed: %d >> avail: %d << min: %d); set to avail",
1529-
w.id, hopping, viaid, mtuNeededByUs, mtuAvailable, minmtu)
1530+
note("wg: %s (4? %t / 6? %t) proxy: maybe hopping %t %s; mtu(needed: %d >> avail: %d << min: %d); set to avail",
1531+
w.id, has4, has6, hopping, viaid, mtuNeededByUs, mtuAvailable, minmtu)
15301532
mtuNeededByUs = mtuAvailable
15311533
} // else: mtu needed is well within the hop's / network's capacity
15321534

15331535
if mtuAvailable < minmtu {
1534-
return log.EE("wg: %s proxy: hopping? %t %s; needs1 %d; avail(%d) < min(%d); %v",
1535-
w.id, hopping, viaid, mtuNeededByUs, mtuAvailable, minmtu, errHopMtuInsufficient)
1536+
return log.EE("wg: (4? %t / 6? %t) %s proxy: hopping? %t %s; needs1 %d; avail(%d) < min(%d); %v",
1537+
w.id, has4, has6, hopping, viaid, mtuNeededByUs, mtuAvailable, minmtu, errHopMtuInsufficient)
15361538
}
15371539

15381540
finalMtu := reconcileMtu(mtuAvailable, mtuNeededByUs, minmtu)
15391541
if finalMtu <= NOMTU {
1540-
return log.EE("wg: %s proxy: hopping? %t %s; needs2 %d or avail %d <= NOMTU(%d); %v",
1541-
w.id, hopping, viaid, mtuNeededByUs, mtuAvailable, finalMtu, errHopMtuInsufficient)
1542+
return log.EE("wg: %s (4? %t / 6? %t) proxy: hopping? %t %s; needs2 %d or avail %d <= NOMTU(%d); %v",
1543+
w.id, has4, has6, hopping, viaid, mtuNeededByUs, mtuAvailable, finalMtu, errHopMtuInsufficient)
15421544
}
15431545

15441546
if !dryrun {
15451547
w.ep.SetMTU(uint32(finalMtu))
15461548
w.wgtun.events <- tun.EventMTUUpdate
15471549
}
1548-
note("wg: %s proxy: hopping %s; mtu(needed:%d, avail: %d => final: %d); hopping? %t, dryrun? %t",
1549-
w.id, viaid, mtuNeededByUs, mtuAvailable, finalMtu, hopping, dryrun)
1550+
note("wg: (4? %t / 6? %t) %s proxy: hopping %s; mtu(needed:%d, avail: %d => final: %d); hopping? %t, dryrun? %t",
1551+
w.id, has4, has6, viaid, mtuNeededByUs, mtuAvailable, finalMtu, hopping, dryrun)
15501552
return nil
15511553
}
15521554

0 commit comments

Comments
 (0)