]> Cypherpunks repositories - gostls13.git/commitdiff
vendor: update golang_org/x/net/route from upstream
authorMikio Hara <mikioh.mikioh@gmail.com>
Thu, 4 Oct 2018 19:47:09 +0000 (04:47 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Thu, 4 Oct 2018 21:36:59 +0000 (21:36 +0000)
Updates the route package to git rev 68fc911 for:
68fc911 re-adjust routing message alignment for FreeBSD 386 emulation
4dfa261 fix typos in comments
ae89d30 avoid unnecessary type conversions

Change-Id: I915e614e464acf85a8fc80f36f05a85a9246bb01
Reviewed-on: https://go-review.googlesource.com/c/139817
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/vendor/golang_org/x/net/route/interface.go
src/vendor/golang_org/x/net/route/sys_freebsd.go
src/vendor/golang_org/x/net/route/syscall.go

index 854906d9c42913f2f32f1ea19318fdb998a502ad..05ef2a9ce3c790071100d0adb48af9552f29ae7e 100644 (file)
@@ -37,7 +37,7 @@ func (m *InterfaceAddrMessage) Sys() []Sys { return nil }
 // address message.
 type InterfaceMulticastAddrMessage struct {
        Version int    // message version
-       Type    int    // messsage type
+       Type    int    // message type
        Flags   int    // interface flags
        Index   int    // interface index
        Addrs   []Addr // addresses
index 89ba1c4e26299c31bb3e27def735d8b744365970..a1a0d79b61555cfb0c183ca99bfdefd38b9c8e93 100644 (file)
@@ -57,7 +57,7 @@ func (m *InterfaceMessage) Sys() []Sys {
 func probeRoutingStack() (int, map[int]*wireFormat) {
        var p uintptr
        wordSize := int(unsafe.Sizeof(p))
-       align := int(unsafe.Sizeof(p))
+       align := wordSize
        // In the case of kern.supported_archs="amd64 i386", we need
        // to know the underlying kernel's architecture because the
        // alignment for routing facilities are set at the build time
@@ -129,6 +129,9 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
                } else {
                        ifm.bodyOff = sizeofIfMsghdrFreeBSD11
                }
+               if rel >= 1102000 { // see https://github.com/freebsd/freebsd/commit/027c7f4d66ff8d8c4a46c3665a5ee7d6d8462034#diff-ad4e5b7f1449ea3fc87bc97280de145b
+                       align = wordSize
+               }
        }
        rtm.parse = rtm.parseRouteMessage
        ifm.parse = ifm.parseInterfaceMessage
index c211188b10b8a09ab799525e747d9ed3bdaa86be..5f69ea63d91e1c05907df70de320d54a1cb67493 100644 (file)
@@ -20,7 +20,7 @@ func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr)
        } 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)), uintptr(newlen))
+       _, _, 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)
        }