mirror of
https://github.com/luscis/openlan.git
synced 2025-10-08 01:50:12 +08:00
fea: openudp: update link state
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package libol
|
||||
|
||||
import (
|
||||
"net"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -201,3 +202,10 @@ func IpMetricSet(name, metric string, opts ...string) ([]byte, error) {
|
||||
return nil, NewErr("IpAddrAdd %s notSupport", runtime.GOOS)
|
||||
}
|
||||
}
|
||||
|
||||
func LookupIP(name string) string {
|
||||
if addr, _ := net.LookupIP(name); len(addr) > 0 {
|
||||
return addr[0].String()
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user