-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1179 from hjarvard/2022Q3/lang__go117
lang/go117: Fix fetch phase and copy patches from lang/go
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- distinfo.orig 2022-07-21 19:25:22 UTC | ||
+++ distinfo | ||
@@ -1,4 +1,6 @@ | ||
TIMESTAMP = 1654605505 | ||
+SHA256 (go-dragonfly-amd64-go1.17.9.tar.xz) = 02416ddcb1154819ef849ba1de1904c660fbc175bc89b6021f14234db450e8da | ||
+SIZE (go-dragonfly-amd64-go1.17.9.tar.xz) = 41653156 | ||
SHA256 (go1.17.11.src.tar.gz) = ac2649a65944c6a5abe55054000eee3d77196880da36a3555f62e06540e8eb54 | ||
SIZE (go1.17.11.src.tar.gz) = 22197784 | ||
SHA256 (go-freebsd-arm64-go1.17.9.tar.xz) = d9e9180bdc5ad0eec1654679a50084ebb31ecbe9bef24f0bd8ba917db8d1830c |
71 changes: 71 additions & 0 deletions
71
ports/lang/go117/dragonfly/patch-src_vendor_golang.org_x_net_b_route_interface__dragonfly.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- src/vendor/golang.org/x/net/route/interface_dragonfly.go.orig 2021-06-22 21:25:22 UTC | ||
+++ src/vendor/golang.org/x/net/route/interface_dragonfly.go | ||
@@ -0,0 +1,68 @@ | ||
+// Copyright 2021 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. | ||
+ | ||
+// Implementation for DragonflyBSD. This is unlikely to work for | ||
+// RTM_VERSION != 7. | ||
+ | ||
+package route | ||
+ | ||
+func (w *wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error) { | ||
+ // b is a struct if_msghdr | ||
+ if len(b) < w.bodyOff { | ||
+ return nil, errMessageTooShort | ||
+ } | ||
+ l := int(nativeEndian.Uint16(b[:2])) | ||
+ if len(b) < l { | ||
+ return nil, errInvalidMessage | ||
+ } | ||
+ attrs := uint(nativeEndian.Uint32(b[12:16])) | ||
+ if attrs&sysRTA_IFP == 0 { | ||
+ return nil, nil | ||
+ } | ||
+ if attrs != sysRTA_IFP { | ||
+ // The call to parseLinkAddr below assumes there's exactly one | ||
+ // address. | ||
+ return nil, errInvalidMessage | ||
+ } | ||
+ m := &InterfaceMessage{ | ||
+ Version: int(b[2]), | ||
+ Type: int(b[3]), | ||
+ Addrs: make([]Addr, sysRTAX_MAX), | ||
+ Flags: int(nativeEndian.Uint32(b[8:12])), | ||
+ Index: int(nativeEndian.Uint16(b[4:6])), | ||
+ extOff: w.extOff, | ||
+ raw: b[:l], | ||
+ } | ||
+ a, err := parseLinkAddr(b[w.bodyOff:]) | ||
+ if err != nil { | ||
+ return nil, err | ||
+ } | ||
+ m.Addrs[sysRTAX_IFP] = a | ||
+ m.Name = a.(*LinkAddr).Name | ||
+ return m, nil | ||
+} | ||
+ | ||
+func (w *wireFormat) parseInterfaceAddrMessage(_ RIBType, b []byte) (Message, error) { | ||
+ // b is a struct ifa_msghdr | ||
+ if len(b) < w.bodyOff { | ||
+ return nil, errMessageTooShort | ||
+ } | ||
+ l := int(nativeEndian.Uint16(b[:2])) | ||
+ if len(b) < l { | ||
+ return nil, errInvalidMessage | ||
+ } | ||
+ m := &InterfaceAddrMessage{ | ||
+ Version: int(b[2]), | ||
+ Type: int(b[3]), | ||
+ Flags: int(nativeEndian.Uint32(b[8:12])), | ||
+ Index: int(nativeEndian.Uint16(b[4:6])), | ||
+ raw: b[:l], | ||
+ } | ||
+ var err error | ||
+ m.Addrs, err = parseAddrs(uint(nativeEndian.Uint32(b[12:16])), parseKernelInetAddr, b[w.bodyOff:]) | ||
+ if err != nil { | ||
+ return nil, err | ||
+ } | ||
+ return m, nil | ||
+} |
13 changes: 13 additions & 0 deletions
13
ports/lang/go117/dragonfly/patch-src_vendor_golang.org_x_net_route_interface__classic.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- src/vendor/golang.org/x/net/route/interface_classic.go.ori 2021-10-23 13:53:01.473807000 +0200 | ||
+++ src/vendor/golang.org/x/net/route/interface_classic.go 2021-10-23 13:53:15.283508000 +0200 | ||
@@ -2,8 +2,8 @@ | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
-//go:build darwin || dragonfly || netbsd | ||
-// +build darwin dragonfly netbsd | ||
+//go:build darwin || netbsd | ||
+// +build darwin netbsd | ||
|
||
package route | ||
|