mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 03:33:43 +00:00
Merge pull request #10544 from FRRouting/mergify/bp/dev/8.2/pr-10530
*: use ipaddr_cmp instead of memcmp (backport #10530)
This commit is contained in:
commit
cd56a45488
@ -4306,7 +4306,7 @@ static bool bgp_evpn_nh_cmp(const void *p1, const void *p2)
|
|||||||
if (n1 == NULL || n2 == NULL)
|
if (n1 == NULL || n2 == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (memcmp(&n1->ip, &n2->ip, sizeof(struct ipaddr)) == 0);
|
return (ipaddr_cmp(&n1->ip, &n2->ip) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bgp_evpn_nh_init(struct bgp *bgp_vrf)
|
void bgp_evpn_nh_init(struct bgp *bgp_vrf)
|
||||||
|
@ -405,7 +405,7 @@ static bool vrrp_has_ip(struct vrrp_vrouter *vr, struct ipaddr *ip)
|
|||||||
struct ipaddr *iter;
|
struct ipaddr *iter;
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(r->addrs, ln, iter))
|
for (ALL_LIST_ELEMENTS_RO(r->addrs, ln, iter))
|
||||||
if (!memcmp(&iter->ip, &ip->ip, IPADDRSZ(ip)))
|
if (!ipaddr_cmp(iter, ip))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -484,7 +484,7 @@ int vrrp_del_ip(struct vrrp_vrouter *vr, struct ipaddr *ip)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS(r->addrs, ln, nn, iter))
|
for (ALL_LIST_ELEMENTS(r->addrs, ln, nn, iter))
|
||||||
if (!memcmp(&iter->ip, &ip->ip, IPADDRSZ(ip)))
|
if (!ipaddr_cmp(iter, ip))
|
||||||
list_delete_node(r->addrs, ln);
|
list_delete_node(r->addrs, ln);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -903,7 +903,7 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
|
|||||||
|
|
||||||
switch (r->fsm.state) {
|
switch (r->fsm.state) {
|
||||||
case VRRP_STATE_MASTER:
|
case VRRP_STATE_MASTER:
|
||||||
addrcmp = memcmp(&src->ip, &r->src.ip, IPADDRSZ(src));
|
addrcmp = ipaddr_cmp(src, &r->src);
|
||||||
|
|
||||||
if (pkt->hdr.priority == 0) {
|
if (pkt->hdr.priority == 0) {
|
||||||
vrrp_send_advertisement(r);
|
vrrp_send_advertisement(r);
|
||||||
|
@ -72,7 +72,7 @@ static bool neigh_cmp(const void *p1, const void *p2)
|
|||||||
if (n1 == NULL || n2 == NULL)
|
if (n1 == NULL || n2 == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (memcmp(&n1->ip, &n2->ip, sizeof(struct ipaddr)) == 0);
|
return ipaddr_cmp(&n1->ip, &n2->ip) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int neigh_list_cmp(void *p1, void *p2)
|
int neigh_list_cmp(void *p1, void *p2)
|
||||||
@ -80,7 +80,7 @@ int neigh_list_cmp(void *p1, void *p2)
|
|||||||
const struct zebra_neigh *n1 = p1;
|
const struct zebra_neigh *n1 = p1;
|
||||||
const struct zebra_neigh *n2 = p2;
|
const struct zebra_neigh *n2 = p2;
|
||||||
|
|
||||||
return memcmp(&n1->ip, &n2->ip, sizeof(struct ipaddr));
|
return ipaddr_cmp(&n1->ip, &n2->ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct hash *zebra_neigh_db_create(const char *desc)
|
struct hash *zebra_neigh_db_create(const char *desc)
|
||||||
|
Loading…
Reference in New Issue
Block a user