diff --git a/listener/tun/ipstack/commons/router_android.go b/listener/tun/ipstack/commons/router_android.go index 172c9ce3..139dbca9 100644 --- a/listener/tun/ipstack/commons/router_android.go +++ b/listener/tun/ipstack/commons/router_android.go @@ -44,7 +44,7 @@ func ConfigInterfaceAddress(dev device.Device, addr netip.Prefix, forceMTU int, return err } - if err = netlink.AddrAdd(metaLink, naddr); err != nil { + if err = netlink.AddrAdd(metaLink, naddr); err != nil && err.Error() != "file exists" { return err } diff --git a/listener/tun/ipstack/commons/router_linux.go b/listener/tun/ipstack/commons/router_linux.go index d5f3edab..a079f535 100644 --- a/listener/tun/ipstack/commons/router_linux.go +++ b/listener/tun/ipstack/commons/router_linux.go @@ -51,7 +51,7 @@ func ConfigInterfaceAddress(dev device.Device, addr netip.Prefix, forceMTU int, return err } - if err = netlink.AddrAdd(metaLink, naddr); err != nil { + if err = netlink.AddrAdd(metaLink, naddr); err != nil && err.Error() != "file exists" { return err } @@ -65,7 +65,7 @@ func ConfigInterfaceAddress(dev device.Device, addr netip.Prefix, forceMTU int, Protocol: 2, Src: ip.AsSlice(), Table: 254, - }); err != nil { + }); err != nil && err.Error() != "file exists" { return err }