mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 22:27:47 +00:00
Merge pull request #5622 from qlyoung/fix-iface-ifindex-compare
lib: fix ifindex comparison overflow
This commit is contained in:
commit
1fa69569c6
7
lib/if.c
7
lib/if.c
@ -137,7 +137,12 @@ static int if_cmp_func(const struct interface *ifp1,
|
||||
static int if_cmp_index_func(const struct interface *ifp1,
|
||||
const struct interface *ifp2)
|
||||
{
|
||||
return ifp1->ifindex - ifp2->ifindex;
|
||||
if (ifp1->ifindex == ifp2->ifindex)
|
||||
return 0;
|
||||
else if (ifp1->ifindex > ifp2->ifindex)
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void ifp_connected_free(void *arg)
|
||||
|
Loading…
Reference in New Issue
Block a user