mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-06 12:13:37 +08:00
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:
@@ -610,7 +610,7 @@ lowpan6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr)
|
||||
dest.addr_len = 2;
|
||||
dest.addr[0] = ((u8_t *)q->payload)[38];
|
||||
dest.addr[1] = ((u8_t *)q->payload)[39];
|
||||
if ((src.addr_len == 2) && (ip6_addr_netcmp_zoneless(&ip6_hdr->src, &ip6_hdr->dest)) &&
|
||||
if ((src.addr_len == 2) && (ip6_addr_net_zoneless_eq(&ip6_hdr->src, &ip6_hdr->dest)) &&
|
||||
(lowpan6_get_address_mode(ip6addr, &dest) == 3)) {
|
||||
MIB2_STATS_NETIF_INC(netif, ifoutucastpkts);
|
||||
return lowpan6_frag(netif, q, &src, &dest);
|
||||
|
||||
@@ -117,7 +117,7 @@ lowpan6_context_lookup(const ip6_addr_t *lowpan6_contexts, const ip6_addr_t *ip6
|
||||
s8_t i;
|
||||
|
||||
for (i = 0; i < LWIP_6LOWPAN_NUM_CONTEXTS; i++) {
|
||||
if (ip6_addr_netcmp(&lowpan6_contexts[i], ip6addr)) {
|
||||
if (ip6_addr_net_eq(&lowpan6_contexts[i], ip6addr)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1128,12 +1128,12 @@ int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2) {
|
||||
|
||||
nsa = dns_getserver(0);
|
||||
ip_addr_set_ip4_u32_val(nsb, ns1);
|
||||
if (ip_addr_cmp(nsa, &nsb)) {
|
||||
if (ip_addr_eq(nsa, &nsb)) {
|
||||
dns_setserver(0, IP_ADDR_ANY);
|
||||
}
|
||||
nsa = dns_getserver(1);
|
||||
ip_addr_set_ip4_u32_val(nsb, ns2);
|
||||
if (ip_addr_cmp(nsa, &nsb)) {
|
||||
if (ip_addr_eq(nsa, &nsb)) {
|
||||
dns_setserver(1, IP_ADDR_ANY);
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -353,7 +353,7 @@ static void pppol2tp_input(void *arg, struct udp_pcb *pcb, struct pbuf *p, const
|
||||
goto free_and_return;
|
||||
}
|
||||
|
||||
if (!ip_addr_cmp(&l2tp->remote_ip, addr)) {
|
||||
if (!ip_addr_eq(&l2tp->remote_ip, addr)) {
|
||||
goto free_and_return;
|
||||
}
|
||||
|
||||
|
||||
@@ -218,8 +218,8 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf **pb)
|
||||
* again & we don't have to do any reordering if it's used.
|
||||
*/
|
||||
INCR(vjs_packets);
|
||||
if (!ip4_addr_cmp(&ip->src, &cs->cs_ip.src)
|
||||
|| !ip4_addr_cmp(&ip->dest, &cs->cs_ip.dest)
|
||||
if (!ip4_addr_eq(&ip->src, &cs->cs_ip.src)
|
||||
|| !ip4_addr_eq(&ip->dest, &cs->cs_ip.dest)
|
||||
|| (*(struct vj_u32_t*)th).v != (((struct vj_u32_t*)&cs->cs_ip)[IPH_HL(&cs->cs_ip)]).v) {
|
||||
/*
|
||||
* Wasn't the first -- search for it.
|
||||
@@ -239,8 +239,8 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf **pb)
|
||||
do {
|
||||
lcs = cs; cs = cs->cs_next;
|
||||
INCR(vjs_searches);
|
||||
if (ip4_addr_cmp(&ip->src, &cs->cs_ip.src)
|
||||
&& ip4_addr_cmp(&ip->dest, &cs->cs_ip.dest)
|
||||
if (ip4_addr_eq(&ip->src, &cs->cs_ip.src)
|
||||
&& ip4_addr_eq(&ip->dest, &cs->cs_ip.dest)
|
||||
&& (*(struct vj_u32_t*)th).v == (((struct vj_u32_t*)&cs->cs_ip)[IPH_HL(&cs->cs_ip)]).v) {
|
||||
goto found;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user