ip: ip6_preflen_to_mask incorrect result for prefix len > 64 20/21520/2
authorAndrew Yourtchenko <ayourtch@gmail.com>
Mon, 26 Aug 2019 12:58:48 +0000 (12:58 +0000)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 26 Aug 2019 14:26:07 +0000 (14:26 +0000)
The as_u64[0] in the result was not correctly filled in for
longer prefix lengths.

Type: fix
Fixes: 1c7104514c

Change-Id: I871772c618475396d1c1c4c699ff77e35097f07e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/vnet/ip/ip.c

index 133767b..c5b43d4 100644 (file)
@@ -235,6 +235,7 @@ ip6_preflen_to_mask (u8 pref_len, ip6_address_t * mask)
     }
   else
     {
+      mask->as_u64[0] = 0xffffffffffffffffL;
       mask->as_u64[1] =
        clib_host_to_net_u64 (0xffffffffffffffffL << (128 - pref_len));
     }