mirror of
https://github.com/golang/net.git
synced 2026-04-01 02:47:08 +09:00
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>
This commit is contained in:
@@ -422,11 +422,9 @@ func parseAddrs(attrs uint, fn func(int, []byte) (int, Addr, error), b []byte) (
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user