*)(start
+ pos * (sizeof(struct
ospf6_router_lsdesc)));
- if ((char *)lsdesc < end) {
+ if ((char *)lsdesc + sizeof(struct ospf6_router_lsdesc)
+ <= end) {
if (buf && (buflen > INET_ADDRSTRLEN * 2)) {
inet_ntop(AF_INET,
&lsdesc->neighbor_interface_id, buf1,
end = (char *)lsa->header + ntohs(lsa->header->length);
current = start;
- do {
+ while (current + sizeof(struct ospf6_prefix) <= end) {
prefix = (struct ospf6_prefix *)current;
if (prefix->prefix_length == 0
|| current + OSPF6_PREFIX_SIZE(prefix) > end) {
inet_ntop(AF_INET6, &in6, buf, buflen);
return (buf);
}
- } while (current <= end);
+ }
}
return NULL;
}
end = (char *)lsa->header + ntohs(lsa->header->length);
current = start;
- do {
+ while (current + sizeof(struct ospf6_prefix) <= end) {
prefix = (struct ospf6_prefix *)current;
if (prefix->prefix_length == 0
|| current + OSPF6_PREFIX_SIZE(prefix) > end) {
prefix->prefix_length);
return (buf);
}
- } while (current <= end);
+ }
}
return (buf);
}