ping: Fix on android
This commit is contained in:
parent
86d96064d5
commit
dd18aa2b86
2 changed files with 3 additions and 3 deletions
|
|
@ -40,7 +40,7 @@ func Connect(privileged bool, controlFunc control.Func, destination netip.Addr)
|
|||
}
|
||||
|
||||
func (c *Conn) ReadIP(buffer *buf.Buffer) error {
|
||||
if c.destination.Is6() || runtime.GOOS == "linux" && !c.privileged {
|
||||
if c.destination.Is6() || (runtime.GOOS == "linux" || runtime.GOOS == "android") && !c.privileged {
|
||||
var readMsg func(b, oob []byte) (n, oobn int, addr netip.Addr, err error)
|
||||
switch conn := c.conn.(type) {
|
||||
case *net.IPConn:
|
||||
|
|
@ -163,7 +163,7 @@ func (c *Conn) ReadICMP(buffer *buf.Buffer) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if c.destination.Is6() || runtime.GOOS == "linux" && !c.privileged {
|
||||
if c.destination.Is6() || (runtime.GOOS == "linux" || runtime.GOOS == "android") && !c.privileged {
|
||||
return nil
|
||||
}
|
||||
if !c.destination.Is6() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue