Brad Fitzpatrick
9bd9f37d29
go.mod: bump wireguard/windows, which moves to using net/netip
...
Updates #5162
Change-Id: If99a3f0000bce0c01bdf44da1d513f236fd7cdf8
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-08-31 08:36:56 -07:00
Brad Fitzpatrick
8725b14056
all: migrate more code code to net/netip directly
...
Instead of going through the tailscale.com/net/netaddr transitional
wrappers.
Updates #5162
Change-Id: I3dafd1c2effa1a6caa9b7151ecf6edd1a3fda3dd
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-08-02 13:59:57 -07:00
Brad Fitzpatrick
a12aad6b47
all: convert more code to use net/netip directly
...
perl -i -npe 's,netaddr.IPPrefixFrom,netip.PrefixFrom,' $(git grep -l -F netaddr.)
perl -i -npe 's,netaddr.IPPortFrom,netip.AddrPortFrom,' $(git grep -l -F netaddr. )
perl -i -npe 's,netaddr.IPPrefix,netip.Prefix,g' $(git grep -l -F netaddr. )
perl -i -npe 's,netaddr.IPPort,netip.AddrPort,g' $(git grep -l -F netaddr. )
perl -i -npe 's,netaddr.IP\b,netip.Addr,g' $(git grep -l -F netaddr. )
perl -i -npe 's,netaddr.IPv6Raw\b,netip.AddrFrom16,g' $(git grep -l -F netaddr. )
goimports -w .
Then delete some stuff from the net/netaddr shim package which is no
longer neeed.
Updates #5162
Change-Id: Ia7a86893fe21c7e3ee1ec823e8aba288d4566cd8
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-07-25 21:53:49 -07:00
Brad Fitzpatrick
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
Brad Fitzpatrick
04c2c5bd80
net/interfaces: define DefaultRouteInterface and State.DefaultRouteInterface
...
It was pretty ill-defined before and mostly for logging. But I wanted
to start depending on it, so define what it is and make Windows match
the other operating systems, without losing the log output we had
before. (and add tests for that)
Change-Id: I0fbbba1cfc67a265d09dd6cb738b73f0f6005247
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-12-29 12:13:15 -08:00
Maisem Ali
eccc2ac6ee
net/interfaces/windows: update Tailscale interface detection logic to
...
account for new wintun naming.
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2021-11-08 07:44:33 -08:00
Brad Fitzpatrick
3606e68721
net/interfaces: fix default route lookup on Windows
...
It wasn't using the right metric. Apparently you're supposed to sum the route
metric and interface metric. Whoops.
While here, optimize a few little things too, not that this code
should be too hot.
Fixes #2707 (at least; probably dups but I'm failing to find)
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-08-26 13:42:20 -07:00
Brad Fitzpatrick
aaf2df7ab1
net/{dnscache,interfaces}: use netaddr.IP.IsPrivate, delete copied code
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-26 20:30:28 -07:00
Brad Fitzpatrick
440566c5d2
net/interfaces: trim getPACWindows whitespace before parsing URL
...
Fixes #2357
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-08 11:26:50 -07:00
Aleksandar Pesic
7b57310966
net/interfaces: use windows API to get the default route instead of parsing `route print` output
...
Fixes : #1470
Signed-off-by: Aleksandar Pesic <peske.nis@gmail.com>
2021-03-19 14:07:36 +01:00
Brad Fitzpatrick
d192bd0f86
net/interfaces: ignore bogus proxy URLs from winhttp [windows]
...
Updates tailscale/corp#853
2020-11-10 11:30:18 -08:00
Alex Brainman
f2ce64f0c6
wgengine/router: unfork winipcfg-go package, use upstream
...
Use golang.zx2c4.com/wireguard/windows/tunnel/winipcfg
instead of github.com/tailscale/winipcfg-go package.
Updates #760
Signed-off-by: Alex Brainman <alex.brainman@gmail.com>
2020-10-13 09:21:22 -07:00
Brad Fitzpatrick
cab3eb995f
net/interfaces: quiet PAC detection logging in no-PAC case, add benchmark
2020-10-01 22:02:39 -07:00
Brad Fitzpatrick
8051ecff55
net/interfaces: add State.PAC field, populate it on Windows
...
Not used for anything yet (except logging), but populate the current
proxy autoconfig PAC URL in Interfaces.State.
A future change will do things based on it.
2020-10-01 15:33:37 -07:00
Brad Fitzpatrick
8893c2ee78
net/interfaces, net/netns: move default route interface code to interfaces
...
To populate interfaces.State.DefaultRouteInterface.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-09-22 19:02:17 -07:00
David Anderson
8f5b52e571
net/netns: add windows support.
...
Also remove rebinding logic from the windows router. Magicsock will
instead rebind based on link change signals.
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-09-14 16:28:49 -07:00
Brad Fitzpatrick
723b9eecb0
net/interfaces: set SysProcAttr.HideWindow to prevent cmd.exe flash on Windows
2020-07-15 12:43:48 -07:00
Brad Fitzpatrick
32156330a8
net/interfaces: add func LikelyHomeRouterIP
...
For discovering where we might direct NAT-PMP/PCP/UPnP queries at in
the future.
2020-07-06 10:38:00 -07:00