summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_snmp.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-04-17 02:14:55 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-04-17 02:14:55 +0200
commit17e2f0bff36fa1805011ba5601e7f2c22685b254 (patch)
treec492141ff16c446d0647a2541ba3a62195d028e9 /zebra/zebra_snmp.c
parentMerge pull request #6247 from FRRouting/nb_conversions (diff)
downloadfrr-17e2f0bff36fa1805011ba5601e7f2c22685b254.tar.xz
frr-17e2f0bff36fa1805011ba5601e7f2c22685b254.zip
zebra: in_addr_cmp and `struct prefix` are not happy
Coverity is complaining that we are looking beyond the end of the pointer. Why not just use prefix_cmp here? Since we are comparing to route_nodes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_snmp.c')
-rw-r--r--zebra/zebra_snmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c
index 5de45c029..89b8238c2 100644
--- a/zebra/zebra_snmp.c
+++ b/zebra/zebra_snmp.c
@@ -266,9 +266,9 @@ static void check_replace(struct route_node *np2, struct route_entry *re2,
return;
}
- if (in_addr_cmp(&(*np)->p.u.prefix, &np2->p.u.prefix) < 0)
+ if (prefix_cmp(&(*np)->p, &np2->p) < 0)
return;
- if (in_addr_cmp(&(*np)->p.u.prefix, &np2->p.u.prefix) > 0) {
+ if (prefix_cmp(&(*np)->p, &np2->p) > 0) {
*np = np2;
*re = re2;
return;