From de5c6ed4bef1ff96f951edb4edf7f49f51f4ad13 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 24 Jul 2023 11:07:09 -0700 Subject: [PATCH] net/art: document valid values of strideTable.prefix Updates #7781 Signed-off-by: David Anderson --- net/art/stride_table.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/art/stride_table.go b/net/art/stride_table.go index 71f3395f5..fad89a8d6 100644 --- a/net/art/stride_table.go +++ b/net/art/stride_table.go @@ -38,8 +38,11 @@ type strideEntry[T any] struct { // The leaves of the binary tree are host routes (/8s). Each parent is a // successively larger prefix that encompasses its children (/7 through /0). type strideTable[T any] struct { - // prefix is the prefix represented by the 0/0 route of this strideTable. It - // is used in multi-level tables to support path compression. + // prefix is the prefix represented by the 0/0 route of this + // strideTable. It is used in multi-level tables to support path + // compression. All strideTables must have a valid prefix + // (non-zero value, passes IsValid()) whose length is a multiple + // of 8 (e.g. /8, /16, but not /15). prefix netip.Prefix // entries is the nodes of the binary tree, laid out in a flattened array. //