From: Yash Ranjan Date: Fri, 11 Dec 2020 05:16:37 +0000 (-0800) Subject: ospf6d: Fix for "show ipv6 ospf6 database intra-prefix" X-Git-Tag: frr-7.5.1~23^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6a04f53f780ed94cc28397ff179eab48b1978326;p=mirror%2Ffrr.git ospf6d: Fix for "show ipv6 ospf6 database intra-prefix" Some prefixes were not shown in the intra-prefix database show command, due to issues with pointer calculation. Signed-off-by: Yash Ranjan --- diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index a34f8d3693..6de223faf4 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -796,7 +796,7 @@ static char *ospf6_intra_prefix_lsa_get_prefix_str(struct ospf6_lsa *lsa, + sizeof(struct ospf6_lsa_header)); prefixnum = ntohs(intra_prefix_lsa->prefix_num); - if (pos > prefixnum) + if ((pos + 1) > prefixnum) return NULL; start = (char *)intra_prefix_lsa @@ -812,8 +812,7 @@ static char *ospf6_intra_prefix_lsa_get_prefix_str(struct ospf6_lsa *lsa, } if (cnt < pos) { - current = - start + pos * OSPF6_PREFIX_SIZE(prefix); + current += OSPF6_PREFIX_SIZE(prefix); cnt++; } else { memset(&in6, 0, sizeof(in6));