You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/net
Andrew Dunham bac4890467 net/portmapper: be smarter about selecting a UPnP device
Previously, we would select the first WANIPConnection2 (and related)
client from the root device, without any additional checks. However,
some routers expose multiple UPnP devices in various states, and simply
picking the first available one can result in attempting to perform a
portmap with a device that isn't functional.

Instead, mimic what the miniupnpc code does, and prefer devices that are
(a) reporting as Connected, and (b) have a valid external IP address.
For our use-case, we additionally prefer devices that have an external
IP address that's a public address, to increase the likelihood that we
can obtain a direct connection from peers.

Finally, we split out fetching the root device (getUPnPRootDevice) from
selecting the best service within that root device (selectBestService),
and add some extensive tests for various UPnP server behaviours.

RELNOTE=Improve UPnP portmapping when multiple UPnP services exist

Updates #8364

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I71795cd80be6214dfcef0fe83115a5e3fe4b8753
10 months ago
..
art net/art: allow non-pointers as values 1 year ago
connstats net/connstats: exclude traffic with internal Tailscale service (#7904) 1 year ago
dns net/dns: use an additional registry setting to disable dynamic DNS updates for our interface on Windows 10 months ago
dnscache net/dnscache: remove completed TODO 11 months ago
dnsfallback net/dnsfallback: add singleflight to recursive resolver 11 months ago
flowtrack all: update copyright and license headers 2 years ago
interfaces net/interfaces: ensure we return valid 'self' IP in LikelyHomeRouterIP 10 months ago
memnet net/memnet: export the network name (#9111) 1 year ago
netaddr all: update copyright and license headers 2 years ago
netcheck net/netcheck: only run HTTP netcheck for tamago clients 10 months ago
neterror net/neterror, wgengine/magicsock: use UDP GSO and GRO on Linux (#7791) 2 years ago
netkernelconf client/tailscale,ipn/{ipnlocal,localapi}: check UDP GRO config (#10071) 11 months ago
netknob all: update copyright and license headers 2 years ago
netmon net/netmon: log when the gateway/self IP changes 1 year ago
netns net/{interfaces,netmon}: remove "interesting", EqualFiltered API 1 year ago
netstat net/{netns,netstat}: use new x/sys/cpu.IsBigEndian 2 years ago
netutil cmd/tailscale: refactor shared utility methods 1 year ago
packet net/packet: split off checksum munging into different pkg 12 months ago
ping net/ping: fix ICMP echo code field to 0 1 year ago
portmapper net/portmapper: be smarter about selecting a UPnP device 10 months ago
proxymux all: update copyright and license headers 2 years ago
routetable net/routetable: include unknown flags in the routetable doctor output 2 years ago
socks5 net/socks5: add password auth support 2 years ago
sockstats net/dns: retry forwarder requests over TCP 1 year ago
speedtest all: update copyright and license headers 2 years ago
stun wgengine/magicsock, types/nettype, etc: finish ReadFromUDPAddrPort netip migration 1 year ago
tcpinfo net/tcpinfo: add package to allow fetching TCP information 1 year ago
tlsdial cmd/tailscale/cli: make netcheck run even if machine lacks TLS certs 1 year ago
tsaddr types/netmap: remove NetworkMap.{Addresses,MachineStatus} 1 year ago
tsdial types/netmap: remove NetworkMap.{Addresses,MachineStatus} 1 year ago
tshttpproxy net/tshttpproxy: don't proxy through ourselves 2 years ago
tstun cmd/tailscaled,net/tstun: fix data race on start-up in TUN mode 12 months ago
wsconn net/wsconn: accept a remote addr string and plumb it through 1 year ago