Skip to content

Commit 6379a8d

Browse files
feat(ci): bump to upstream 1.74.1 (#12)
https://tailscale.com/changelog#2024-09-18
2 parents 7a43460 + e88f463 commit 6379a8d

File tree

6 files changed

+26
-14
lines changed

6 files changed

+26
-14
lines changed

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.74.0
1+
1.74.1

go.toolchain.rev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0a7392ba4471f578e5160b6ea21def6ae8e4a072
1+
ed9dc37b2b000f376a3e819cbb159e2c17a2dac6

tstest/integration/nat/nat_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,15 @@ func easyPMP(c *vnet.Config) *vnet.Node {
171171
fmt.Sprintf("192.168.%d.1/24", n), vnet.EasyNAT, vnet.NATPMP))
172172
}
173173

174-
// easy + port mapping + host firewall
175-
func easyPMPFW(c *vnet.Config) *vnet.Node {
174+
// easy + port mapping + host firewall + BPF
175+
func easyPMPFWPlusBPF(c *vnet.Config) *vnet.Node {
176176
n := c.NumNodes() + 1
177177
return c.AddNode(
178178
vnet.HostFirewall,
179+
vnet.TailscaledEnv{
180+
Key: "TS_ENABLE_RAW_DISCO",
181+
Value: "true",
182+
},
179183
vnet.TailscaledEnv{
180184
Key: "TS_DEBUG_RAW_DISCO",
181185
Value: "1",
@@ -199,8 +203,8 @@ func easyPMPFWNoBPF(c *vnet.Config) *vnet.Node {
199203
return c.AddNode(
200204
vnet.HostFirewall,
201205
vnet.TailscaledEnv{
202-
Key: "TS_DEBUG_DISABLE_RAW_DISCO",
203-
Value: "1",
206+
Key: "TS_ENABLE_RAW_DISCO",
207+
Value: "false",
204208
},
205209
c.AddNetwork(
206210
fmt.Sprintf("2.%d.%d.%d", n, n, n), // public IP
@@ -531,7 +535,7 @@ func TestSameLAN(t *testing.T) {
531535
// * client machine has a stateful host firewall (e.g. ufw)
532536
func TestBPFDisco(t *testing.T) {
533537
nt := newNatTest(t)
534-
nt.runTest(easyPMPFW, hard)
538+
nt.runTest(easyPMPFWPlusBPF, hard)
535539
nt.want(routeDirect)
536540
}
537541

wgengine/magicsock/magicsock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,13 @@ func NewConn(opts Options) (*Conn, error) {
508508
if d4, err := c.listenRawDisco("ip4"); err == nil {
509509
c.logf("[v1] using BPF disco receiver for IPv4")
510510
c.closeDisco4 = d4
511-
} else {
511+
} else if !errors.Is(err, errors.ErrUnsupported) {
512512
c.logf("[v1] couldn't create raw v4 disco listener, using regular listener instead: %v", err)
513513
}
514514
if d6, err := c.listenRawDisco("ip6"); err == nil {
515515
c.logf("[v1] using BPF disco receiver for IPv6")
516516
c.closeDisco6 = d6
517-
} else {
517+
} else if !errors.Is(err, errors.ErrUnsupported) {
518518
c.logf("[v1] couldn't create raw v6 disco listener, using regular listener instead: %v", err)
519519
}
520520

wgengine/magicsock/magicsock_default.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ package magicsock
77

88
import (
99
"errors"
10+
"fmt"
1011
"io"
1112

1213
"tailscale.com/types/logger"
1314
"tailscale.com/types/nettype"
1415
)
1516

1617
func (c *Conn) listenRawDisco(family string) (io.Closer, error) {
17-
return nil, errors.New("raw disco listening not supported on this OS")
18+
return nil, fmt.Errorf("raw disco listening not supported on this OS: %w", errors.ErrUnsupported)
1819
}
1920

2021
func trySetSocketBuffer(pconn nettype.PacketConn, logf logger.Logf) {

wgengine/magicsock/magicsock_linux.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ const (
3838
discoMinHeaderSize = len(disco.Magic) + 32 /* key length */ + disco.NonceLen
3939
)
4040

41-
// Enable/disable using raw sockets to receive disco traffic.
42-
var debugDisableRawDisco = envknob.RegisterBool("TS_DEBUG_DISABLE_RAW_DISCO")
41+
var (
42+
// Opt-in for using raw sockets to receive disco traffic; added for
43+
// #13140 and replaces the older "TS_DEBUG_DISABLE_RAW_DISCO".
44+
envknobEnableRawDisco = envknob.RegisterBool("TS_ENABLE_RAW_DISCO")
45+
)
4346

4447
// debugRawDiscoReads enables logging of raw disco reads.
4548
var debugRawDiscoReads = envknob.RegisterBool("TS_DEBUG_RAW_DISCO")
@@ -166,8 +169,12 @@ var (
166169
// and BPF filter.
167170
// https://github.com/tailscale/tailscale/issues/3824
168171
func (c *Conn) listenRawDisco(family string) (io.Closer, error) {
169-
if debugDisableRawDisco() {
170-
return nil, errors.New("raw disco listening disabled by debug flag")
172+
if !envknobEnableRawDisco() {
173+
// Return an 'errors.ErrUnsupported' to prevent the callee from
174+
// logging; when we switch this to an opt-out (vs. an opt-in),
175+
// drop the ErrUnsupported so that the callee logs that it was
176+
// disabled.
177+
return nil, fmt.Errorf("raw disco not enabled: %w", errors.ErrUnsupported)
171178
}
172179

173180
// https://github.com/tailscale/tailscale/issues/5607

0 commit comments

Comments
 (0)