route: remove check for unparsed route message bytes
Under some circumstances, DragonFly BSD appears to put more addresses
in route messages than are indicated in the message header. Remove
the recently-added check for unparsed bytes in a route message to
avoid errors.
Change-Id: Id567e4cd49470970f78dbd2decd682c4c00b27fa
Reviewed-on: https://go-review.googlesource.com/c/net/+/322429
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/route/address.go b/route/address.go
index 9edb562..1898ed0 100644
--- a/route/address.go
+++ b/route/address.go
@@ -422,11 +422,9 @@
b = b[l:]
}
}
- if len(b) > 4 {
- // If there is more data left over after parsing all addresses
- // than might be needed for alignment, then we have made a mistake
- // somewhere.
- return nil, errInvalidMessage
- }
+ // The only remaining bytes in b should be alignment.
+ // However, under some circumstances DragonFly BSD appears to put
+ // more addresses in the message than are indicated in the address
+ // bitmask, so don't check for this.
return as[:], nil
}