net/portmapper: improve handling of UPnP parse errors

Without the continue, we might overwrite our current meta
with a zero meta.

Log the error, so that we can check for anything unexpected.

Change-Id: Ia0124e19b7df1191a7685aee949fd19336e41a76
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
(cherry picked from commit a8cc519c70)
This commit is contained in:
Josh Bleecher Snyder 2021-11-30 11:43:54 -08:00 committed by Brad Fitzpatrick
parent 32210788a2
commit 71be839f03

View File

@ -763,6 +763,7 @@ func (c *Client) Probe(ctx context.Context) (res ProbeResult, err error) {
meta, err := parseUPnPDiscoResponse(buf[:n])
if err != nil {
c.logf("unrecognized UPnP discovery response; ignoring")
continue
}
c.logf("[v1] UPnP reply %+v, %q", meta, buf[:n])
res.UPnP = true