--- libgo/go/syscall/route_bsdsunix_32bit.go.orig 2020-03-04 19:30:03.000000000 +1100 +++ libgo/go/syscall/route_bsdsunix_32bit.go 2020-09-22 00:19:38.586358000 +1000 @@ -0,0 +1,32 @@ +// Copyright 2014 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. + +// +build bsdsunix,386 bsdsunix,arm + +package syscall + +import "unsafe" + +func (any *anyMessage) parseRouteMessage(b []byte) *RouteMessage { + p := (*RouteMessage)(unsafe.Pointer(any)) + off := int(unsafe.Offsetof(p.Header.Rmx)) + SizeofRtMetrics + if bsdsunixConfArch == "amd64" { + off += SizeofRtMetrics // rt_metrics on amd64 is simply doubled + } + return &RouteMessage{Header: p.Header, Data: b[rsaAlignOf(off):any.Msglen]} +} + +func (any *anyMessage) parseInterfaceMessage(b []byte) *InterfaceMessage { + p := (*InterfaceMessage)(unsafe.Pointer(any)) + // BSDSUniX 2 and beyond have a restructured mbuf + // packet header view. + if bsdsunixVersion >= 200000 { + m := (*ifMsghdr)(unsafe.Pointer(any)) + p.Header.Data.Hwassist = uint32(m.Data.Hwassist) + p.Header.Data.Epoch = m.Data.Epoch + p.Header.Data.Lastchange = m.Data.Lastchange + return &InterfaceMessage{Header: p.Header, Data: b[int(unsafe.Offsetof(p.Header.Data))+int(p.Header.Data.Datalen) : any.Msglen]} + } + return &InterfaceMessage{Header: p.Header, Data: b[int(unsafe.Offsetof(p.Header.Data))+int(p.Header.Data.Datalen) : any.Msglen]} +}