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>
+ 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
}
if (cnt < pos) {
- current =
- start + pos * OSPF6_PREFIX_SIZE(prefix);
+ current += OSPF6_PREFIX_SIZE(prefix);
cnt++;
} else {
memset(&in6, 0, sizeof(in6));