diff options
| author | Yash Ranjan <ranjany@vmware.com> | 2020-12-10 21:16:37 -0800 |
|---|---|---|
| committer | Yash Ranjan <ranjany@vmware.com> | 2020-12-10 21:25:41 -0800 |
| commit | 8044f7aa553b22e94608eabbfef818452da2f628 (patch) | |
| tree | b9f33fba84168379920d772de6104afb96978c1e /ospf6d/ospf6_intra.c | |
| parent | 101ad544fa5467ef14fb81fb9566df0196c0ae8f (diff) | |
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 <ranjany@vmware.com>
Diffstat (limited to 'ospf6d/ospf6_intra.c')
| -rw-r--r-- | ospf6d/ospf6_intra.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index be5069c88d..91945f9791 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)); |
