mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
lib: Replace usage of in6addr_cmp with memcmp
memcmp will return and act exactly the same as in6addr_cmp but it does it significantly faster than how in6addr_cmp does it. Let this be a lesson for implementing something that is a duplicate of what is provided by the c library. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
35dbbacc3b
commit
7ebda3892c
|
@ -621,7 +621,8 @@ int sockunion_cmp(const union sockunion *su1, const union sockunion *su2)
|
|||
return -1;
|
||||
}
|
||||
if (su1->sa.sa_family == AF_INET6)
|
||||
return in6addr_cmp(&su1->sin6.sin6_addr, &su2->sin6.sin6_addr);
|
||||
return IN6_ADDR_CMP(&su1->sin6.sin6_addr, &su2->sin6.sin6_addr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue