fix: route on android

This commit is contained in:
adlyq 2022-05-28 23:29:22 +08:00
parent 9b999e72ce
commit 39e7832676

View file

@ -49,16 +49,6 @@ func ConfigInterfaceAddress(dev device.Device, addr netip.Prefix, forceMTU int,
return err
}
if err = netlink.RouteAdd(&netlink.Route{
LinkIndex: metaLink.Attrs().Index,
Scope: netlink.SCOPE_LINK,
Protocol: 2,
Src: ip.AsSlice(),
Table: 254,
}); err != nil {
return err
}
if autoRoute {
err = configInterfaceRouting(metaLink.Attrs().Index, interfaceName, ip)
}
@ -80,7 +70,7 @@ func configInterfaceRouting(index int, interfaceName string, ip netip.Addr) erro
Protocol: 2,
Src: ip.AsSlice(),
Dst: ipn,
Table: 254,
Table: tableId,
}); err != nil {
return err
}