Update contrib/mobile for the latest iOS build

This commit is contained in:
Neil Alexander 2023-06-06 22:11:49 +01:00
parent 1420ea5662
commit db9b57c052
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
6 changed files with 73 additions and 13 deletions

View file

@ -37,6 +37,7 @@ type TunAdapter struct {
isOpen bool
isEnabled bool // Used by the writer to drop sessionTraffic if not enabled
config struct {
fd int32
name InterfaceName
mtu InterfaceMTU
}
@ -119,7 +120,13 @@ func (tun *TunAdapter) _start() error {
if tun.rwc.MaxMTU() < mtu {
mtu = tun.rwc.MaxMTU()
}
if err := tun.setup(string(tun.config.name), addr, mtu); err != nil {
var err error
if tun.config.fd > 0 {
err = tun.setupFD(tun.config.fd, addr, mtu)
} else {
err = tun.setup(string(tun.config.name), addr, mtu)
}
if err != nil {
return err
}
if tun.MTU() != mtu {