net/tstun: fix build on arm

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/2687/head
Maisem Ali 3 years ago committed by Maisem Ali
parent fcca374fa7
commit 1f006025c2

@ -26,7 +26,7 @@ func diagnoseLinuxTUNFailure(tunName string, logf logger.Logf) {
logf("no TUN, and failed to look up kernel version: %v", err) logf("no TUN, and failed to look up kernel version: %v", err)
return return
} }
kernel := utsField(&un.Release) kernel := utsReleaseField(&un)
logf("Linux kernel version: %s", kernel) logf("Linux kernel version: %s", kernel)
modprobeOut, err := exec.Command("/sbin/modprobe", "tun").CombinedOutput() modprobeOut, err := exec.Command("/sbin/modprobe", "tun").CombinedOutput()
@ -84,9 +84,9 @@ func diagnoseLinuxTUNFailure(tunName string, logf logger.Logf) {
} }
} }
func utsField(p *[65]int8) string { func utsReleaseField(u *syscall.Utsname) string {
var sb strings.Builder var sb strings.Builder
for _, v := range p { for _, v := range u.Release {
if v == 0 { if v == 0 {
break break
} }

Loading…
Cancel
Save