route: always go through syscall package

Instead of relying on syscall.Syscall, always reach into the syscall
package to call the appropriate functions on Unix systems. We were
already doing this on Darwin. We also have to do this on
OpenBSD. Rather than sometimes reach into syscall and sometimes not,
just always reach in.

For golang/go#42064

Change-Id: Ie292a56766080d0c5ae6b6723d42b5475128290c
Reviewed-on: https://go-review.googlesource.com/c/net/+/366354
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
diff --git a/route/syscall.go b/route/syscall.go
index 97166dd..68d37c9 100644
--- a/route/syscall.go
+++ b/route/syscall.go
@@ -2,28 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build dragonfly || freebsd || netbsd || openbsd
-// +build dragonfly freebsd netbsd openbsd
+//go:build darwin || dragonfly || freebsd || netbsd || openbsd
+// +build darwin dragonfly freebsd netbsd openbsd
 
 package route
 
-import (
-	"syscall"
-	"unsafe"
-)
+import _ "unsafe" // for linkname
 
-var zero uintptr
-
-func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
-	var p unsafe.Pointer
-	if len(mib) > 0 {
-		p = unsafe.Pointer(&mib[0])
-	} else {
-		p = unsafe.Pointer(&zero)
-	}
-	_, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), newlen)
-	if errno != 0 {
-		return error(errno)
-	}
-	return nil
-}
+//go:linkname sysctl syscall.sysctl
+func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error
diff --git a/route/syscall_go1_12_darwin.go b/route/syscall_go1_12_darwin.go
deleted file mode 100644
index 7a13e4f..0000000
--- a/route/syscall_go1_12_darwin.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.12
-// +build go1.12
-
-package route
-
-import _ "unsafe" // for linkname
-
-//go:linkname sysctl syscall.sysctl
-func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error