Avoid sticky sockets on Android
The android policy routing system does insane things.
This commit is contained in:
parent
b4cef2524f
commit
65a74f3175
@ -1,4 +1,4 @@
|
|||||||
// +build !linux
|
// +build !linux android
|
||||||
|
|
||||||
/* SPDX-License-Identifier: GPL-2.0
|
/* SPDX-License-Identifier: GPL-2.0
|
||||||
*
|
*
|
||||||
@ -143,9 +143,12 @@ func (bind *NativeBind) Send(buff []byte, endpoint Endpoint) error {
|
|||||||
var fwmarkIoctl int
|
var fwmarkIoctl int
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if runtime.GOOS == "freebsd" {
|
switch runtime.GOOS {
|
||||||
|
case "linux", "android":
|
||||||
|
fwmarkIoctl = 36 /* unix.SO_MARK */
|
||||||
|
case "freebsd":
|
||||||
fwmarkIoctl = 0x1015 /* unix.SO_USER_COOKIE */
|
fwmarkIoctl = 0x1015 /* unix.SO_USER_COOKIE */
|
||||||
} else if runtime.GOOS == "openbsd" {
|
case "openbsd":
|
||||||
fwmarkIoctl = 0x1021 /* unix.SO_RTABLE */
|
fwmarkIoctl = 0x1021 /* unix.SO_RTABLE */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// +build !android
|
||||||
|
|
||||||
/* SPDX-License-Identifier: GPL-2.0
|
/* SPDX-License-Identifier: GPL-2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
|
* Copyright (C) 2017-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
|
||||||
|
Loading…
Reference in New Issue
Block a user