Skip to content

Commit 2e85ce4

Browse files
committed
ipn/wg: inform Device of mtu changes
1 parent da4a95d commit 2e85ce4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

intra/ipn/wgproxy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ func newdevice(wgtun *wgtun, wgep wgconn, uapicfg string) (*device.Device, error
714714
// github.com/WireGuard/wireguard-android/blob/713947e432/tunnel/tools/libwg-go/api-android.go#L99
715715
wgdev.DisableSomeRoamingForBrokenMobileSemantics()
716716

717-
err = wgdev.Up()
717+
err = wgdev.Up() // needed? tun.EventUp is already queued by makeWgTun()
718718
if err != nil {
719719
defer wgdev.Close()
720720
log.E("proxy: wg: %s failed init %v", wgtun.id, err)
@@ -1492,6 +1492,7 @@ func (w *wgproxy) maybeResetMtu(via Proxy, dryrun bool) error {
14921492

14931493
if !dryrun {
14941494
w.ep.SetMTU(uint32(finalMtu))
1495+
w.wgtun.events <- tun.EventMTUUpdate
14951496
}
14961497
note("wg: %s proxy: hopping %s; mtu(needed:%d, avail: %d => final: %d); hopping? %t, dryrun? %t",
14971498
w.id, viaid, mtuNeededByUs, mtuAvailable, finalMtu, hopping, dryrun)

0 commit comments

Comments
 (0)