From 484fea238a654cf0ca987bdd5de77f3c9d523fc8 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Fri, 21 Feb 2025 00:04:34 +0000 Subject: [PATCH] Silence compiler warning. --- src/option.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/option.c b/src/option.c index 636b238..0cc76a3 100644 --- a/src/option.c +++ b/src/option.c @@ -2675,15 +2675,15 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma if (msize > 128) ret_err_free(_("bad prefix length"), new); - mask = (1LLU << (128 - msize)) - 1LLU; + /* prefix==64 overflows the mask calculation */ + if (msize <= 64) + mask = (u64)-1LL; + else + mask = (1LLU << (128 - msize)) - 1LLU; new->is6 = 1; new->prefixlen = msize; - /* prefix==64 overflows the mask calculation above */ - if (msize <= 64) - mask = (u64)-1LL; - new->end6 = new->start6; setaddr6part(&new->start6, addrpart & ~mask); setaddr6part(&new->end6, addrpart | mask);