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
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
..
dnscache net/dnscache: work on IPv6-only hosts (again) 4 years ago
flowtrack net/flowtrack: add Tuple.String method 4 years ago
interfaces net/interfaces: use a uint32_t for ipv4 address 4 years ago
netcheck netcheck: use reflect in sortRegions test. 4 years ago
netns net/netns: remove use of unsafe on Windows 4 years ago
netstat net/netstat: remove a bit more unsafe 4 years ago
nettest net/nettest: de-flake tests on Windows 4 years ago
packet net/packet, wgengine, tstun: add inter-node TSMP protocol for connect errors 4 years ago
stun net/stun: Fix STUN attribute padding (#710) 4 years ago
tlsdial net/tlsdial, derp/derphttp: finish DERPNode.CertName validation 5 years ago
tsaddr net/tsaddr: add ChromeOS contains tests 4 years ago
tshttpproxy net/tshttpproxy: aggressively rate-limit error logs in Transport.Proxy path 4 years ago