You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/net/interfaces
David Crawshaw d139fa9c92 net/interfaces: use a uint32_t for ipv4 address
The code was using a C "int", which is a signed 32-bit integer.
That means some valid IP addresses were negative numbers.
(In particular, the default router address handed out by AT&T
fiber: 192.168.1.254. No I don't know why they do that.)
A negative number is < 255, and so was treated by the Go code
as an error.

This fixes the unit test failure:

	$ go test -v -run=TestLikelyHomeRouterIPSyscallExec ./net/interfaces
	=== RUN   TestLikelyHomeRouterIPSyscallExec
	    interfaces_darwin_cgo_test.go:15: syscall() = invalid IP, false, netstat = 192.168.1.254, true
	--- FAIL: TestLikelyHomeRouterIPSyscallExec (0.00s)

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
4 years ago
..
interfaces.go net/interfaces: don't send over zt* interfaces 4 years ago
interfaces_darwin.go go.mod: upgrade staticcheck to 0.1.0 4 years ago
interfaces_darwin_cgo.go net/interfaces: use a uint32_t for ipv4 address 4 years ago
interfaces_darwin_cgo_test.go net/interfaces: use syscalls to find private gateway IP address 4 years ago
interfaces_darwin_nocgo.go net/interfaces: use syscalls to find private gateway IP address 4 years ago
interfaces_defaultrouteif_todo.go net/interfaces, net/netns: move default route interface code to interfaces 4 years ago
interfaces_linux.go net/netns, net/interfaces: move defaultRouteInterface, add Android fallback 4 years ago
interfaces_linux_test.go net/netns, net/interfaces: move defaultRouteInterface, add Android fallback 4 years ago
interfaces_test.go net/interfaces: remove IsTailscaleIP, make callers use tsaddr. 4 years ago
interfaces_windows.go net/interfaces: ignore bogus proxy URLs from winhttp [windows] 4 years ago
interfaces_windows_test.go net/interfaces: quiet PAC detection logging in no-PAC case, add benchmark 4 years ago
route.h net/interfaces: use syscalls to find private gateway IP address 4 years ago