Rename IP and Ethernet equality checkers from _cmp to _eq

Functions ending in cmp are expected to return 0 on equality but these
return non-zero.

eth_addr_cmp -> eth_addr_eq

ip_addr_cmp -> ip_addr_eq
ip4_addr_cmp -> ip4_addr_eq
ip6_addr_cmp -> ip6_addr_eq

ip_addr_netcmp -> ip_addr_net_eq
ip4_addr_netcmp -> ip4_addr_net_eq
ip6_addr_netcmp -> ip6_addr_net_eq

ip_addr_cmp_zoneless -> ip_addr_zoneless_eq
ip6_addr_cmp_zoneless -> ip6_addr_zoneless_eq

ip6_addr_cmp_zone -> ip6_addr_zone_eq
ip6_addr_netcmp_zoneless -> ip6_addr_net_zoneless_eq
ip6_addr_nethostcmp -> ip6_addr_nethost_eq
ip6_addr_cmp_packed -> ip6_addr_packed_eq
ip6_addr_cmp_solicitednode -> ip6_addr_solicitednode_eq

All call sites have been changed, and fallback macros have been added to not
break external users.
This commit is contained in:
Erik Ekman
2020-07-07 16:55:52 +02:00
parent 047f3b3306
commit 264a5a3e97
41 changed files with 211 additions and 162 deletions

View File

@@ -128,7 +128,7 @@ tcp_md5_get_info(const struct tcp_pcb *pcb, const ip_addr_t *remote_ip, u16_t re
if (pcb != NULL) {
struct tcp_md5_conn_info *info = (struct tcp_md5_conn_info *)tcp_ext_arg_get(pcb, tcp_md5_extarg_id);
while (info != NULL) {
if (ip_addr_cmp(&info->remote_addr, remote_ip)) {
if (ip_addr_eq(&info->remote_addr, remote_ip)) {
if (info->remote_port == remote_port) {
return info;
}
@@ -157,7 +157,7 @@ tcp_md5_extarg_passive_open(u8_t id, struct tcp_pcb_listen *lpcb, struct tcp_pcb
iter = (struct tcp_md5_conn_info *)tcp_ext_arg_get((struct tcp_pcb *)lpcb, id);
while (iter != NULL) {
if (iter->remote_port == cpcb->remote_port) {
if (ip_addr_cmp(&iter->remote_addr, &cpcb->remote_ip)) {
if (ip_addr_eq(&iter->remote_addr, &cpcb->remote_ip)) {
struct tcp_md5_conn_info *info = tcp_md5_conn_info_alloc();
if (info != NULL) {
memcpy(info, iter, sizeof(struct tcp_md5_conn_info));