diff options
| author | David Crawshaw <crawshaw@tailscale.com> | 2021-02-02 10:03:26 -0800 |
|---|---|---|
| committer | David Crawshaw <crawshaw@tailscale.com> | 2021-02-02 10:06:12 -0800 |
| commit | a5166565a7cf201a2d6ac8d207a236db1bce1db3 (patch) | |
| tree | 86d5ade7d218addab0a8e6c06c48b8ed49030abc /scripts | |
| parent | 516e8a483807d49b77c775d88fc148db0da8a2cd (diff) | |
| download | tailscale-crawshaw/ipuint.tar.xz tailscale-crawshaw/ipuint.zip | |
net/interfaces: use a uint32_t for ipv4 addresscrawshaw/ipuint
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>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
