6a396731eb
all: use various net/netip parse funcs directly
...
Mechanical change with perl+goimports.
Changed {Must,}Parse{IP,IPPrefix,IPPort} to their netip variants, then
goimports -d .
Finally, removed the net/netaddr wrappers, to prevent future use.
Updates #5162
Change-Id: I59c0e38b5fbca5a935d701645789cddf3d7863ad
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2022-07-25 21:12:28 -07:00
7eaf5e509f
net/netaddr: start migrating to net/netip via new netaddr adapter package
...
Updates #5162
Change-Id: Id7bdec303b25471f69d542f8ce43805328d56c12
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2022-07-25 16:20:43 -07:00
b5553c6ad2
net/portmap: run go fmt
...
Signed-off-by: Denton Gentry <dgentry@tailscale.com >
2022-06-28 03:55:17 -07:00
7fffddce8e
net/portmapper: enable for iOS
...
In the 1.27 unstable releases we set the min-version to iOS15,
which means we have 50 MBytes of RAM in the Network Extension.
https://tailscale.com/blog/go-linker/
Include the UPnP/NAT-PMP/PCP portmapper support now that there
is memory for it.
Fixes https://github.com/tailscale/tailscale/issues/2495
Signed-off-by: Denton Gentry <dgentry@tailscale.com >
2022-06-09 10:40:25 -07:00
27a1ad6a70
wasm: exclude code that's not used on iOS for Wasm too
...
It has similar size constraints. Saves ~1.9MB from the Wasm build.
Updates #3157
Signed-off-by: Mihai Parparita <mihai@tailscale.com >
2022-06-06 13:52:52 -07:00
758c37b83d
net/netns: thread logf into control functions
...
So that darwin can log there without panicking during tests.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com >
2021-11-18 15:09:51 -08:00
b9bd7dbc5d
net/portmapper: log upnp information
...
This logs some basic statistics for UPnP, so that tailscale can better understand what routers
are being used and how to connect to them.
Signed-off-by: julianknodt <julianknodt@gmail.com >
2021-08-10 22:45:00 -07:00
85304d7392
net/portmapper: check disable flags
...
Signed-off-by: julianknodt <julianknodt@gmail.com >
2021-08-06 07:51:30 -07:00
a5da4ed981
all: gofmt with Go 1.17
...
This adds "//go:build" lines and tidies up existing "// +build" lines.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com >
2021-08-05 15:54:00 -07:00
fdc081c291
net/portmapper: fix UPnP probing, work against all ports
...
Prior to Tailscale 1.12 it detected UPnP on any port.
Starting with Tailscale 1.11.x, it stopped detecting UPnP on all ports.
Then start plumbing its discovered Location header port number to the
code that was assuming port 5000.
Fixes #2109
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2021-08-04 12:49:49 -07:00
7b295f3d21
net/portmapper: disable UPnP on iOS for now
...
Updates #2495
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2021-07-22 13:33:38 -07:00
3a4201e773
net/portmapper: return correct upnp port
...
Previously, this was incorrectly returning the internal port, and using that with the external
exposed IP when it did not use WANIPConnection2. In the case when we must provide a port, we
return it instead.
Noticed this while implementing the integration test for upnp.
Signed-off-by: julianknodt <julianknodt@gmail.com >
2021-07-21 10:11:47 -07:00
171ec9f8f4
control/{controlknobs,controlclient}: simplify knobs API, fix controlclient crash
...
From integration tests elsewhere:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x845c9b]
goroutine 226 [running]:
tailscale.com/control/controlclient.(*Direct).sendMapRequest(0xc00053e1e0, 0x16670f0, 0xc000353780, 0xffffffffffffffff, 0xc0003e5f10, 0x0, 0x0)
/home/runner/go/pkg/mod/tailscale.com@v1.1.1-0.20210715222212-1bb6abc604c1/control/controlclient/direct.go:803 +0x19bb
tailscale.com/control/controlclient.(*Direct).PollNetMap(...)
/home/runner/go/pkg/mod/tailscale.com@v1.1.1-0.20210715222212-1bb6abc604c1/control/controlclient/direct.go:574
tailscale.com/control/controlclient.(*Auto).mapRoutine(0xc00052a1e0)
/home/runner/go/pkg/mod/tailscale.com@v1.1.1-0.20210715222212-1bb6abc604c1/control/controlclient/auto.go:464 +0x571
created by tailscale.com/control/controlclient.(*Auto).Start
/home/runner/go/pkg/mod/tailscale.com@v1.1.1-0.20210715222212-1bb6abc604c1/control/controlclient/auto.go:151 +0x65
exit status 2
Also remove types/opt.Bool API addition which is now unnecessary.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2021-07-15 22:34:50 -07:00
1bb6abc604
net/portmapper: add upnp port mapping
...
Add in UPnP portmapping, using goupnp library in order to get the UPnP client and run the
portmapping functions. This rips out anywhere where UPnP used to be in portmapping, and has a
flow separate from PMP and PCP.
RELNOTE=portmapper now supports UPnP mappings
Fixes #682
Updates #2109
Signed-off-by: julianknodt <julianknodt@gmail.com >
2021-07-15 15:22:12 -07:00