From 28f1cbb00710c7eae1fac86cbce21d4351237a13 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 25 Nov 2020 00:12:00 +1100 Subject: [PATCH] Add comment about cookie sizes (cherry picked from commit 304df539919beb5da6d33d8690b5e588476308d8) --- lib/dns/rdata/generic/opt_41.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dns/rdata/generic/opt_41.c b/lib/dns/rdata/generic/opt_41.c index 36ae6abe76..40fcbe7885 100644 --- a/lib/dns/rdata/generic/opt_41.c +++ b/lib/dns/rdata/generic/opt_41.c @@ -193,6 +193,10 @@ fromwire_opt(ARGS_FROMWIRE) { isc_region_consume(&sregion, length); break; case DNS_OPT_COOKIE: + /* + * Client cookie alone has length 8. + * Client + server cookie is 8 + [8..32]. + */ if (length != 8 && (length < 16 || length > 40)) { return (DNS_R_OPTERR); }