]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: Fix for "show ipv6 ospf6 database link" 7714/head
authorYash Ranjan <ranjany@vmware.com>
Fri, 11 Dec 2020 05:19:55 +0000 (21:19 -0800)
committerYash Ranjan <ranjany@vmware.com>
Fri, 11 Dec 2020 06:24:19 +0000 (22:24 -0800)
Some prefixes were not shown in the link database
show command, due to issues with pointer calculation.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
ospf6d/ospf6_intra.c

index 6de223faf465f9900a611f085b64a23ef16c5a8c..d07b04d90e7a270be64fc6fa5256431f3f8c7403 100644 (file)
@@ -609,9 +609,8 @@ static char *ospf6_link_lsa_get_prefix_str(struct ospf6_lsa *lsa, char *buf,
                                return NULL;
                        }
 
-                       if (cnt < pos) {
-                               current =
-                                       start + pos * OSPF6_PREFIX_SIZE(prefix);
+                       if (cnt < (pos - 1)) {
+                               current += OSPF6_PREFIX_SIZE(prefix);
                                cnt++;
                        } else {
                                memset(&in6, 0, sizeof(in6));