mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-03 21:14:40 +08:00
src/core: fix gcc analyzer warning
Make ip4_addr_isany check first to avoid warning: "check of 'ipaddr' for NULL after already dereferencing it [-Werror=analyzer-deref-before-check]"
This commit is contained in:
parent
ca0395c5ae
commit
571c46253f
@ -940,9 +940,9 @@ etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q)
|
|||||||
netif_addr_idx_t i;
|
netif_addr_idx_t i;
|
||||||
|
|
||||||
/* non-unicast address? */
|
/* non-unicast address? */
|
||||||
if (ip4_addr_isbroadcast(ipaddr, netif) ||
|
if (ip4_addr_isany(ipaddr) ||
|
||||||
ip4_addr_ismulticast(ipaddr) ||
|
ip4_addr_isbroadcast(ipaddr, netif) ||
|
||||||
ip4_addr_isany(ipaddr)) {
|
ip4_addr_ismulticast(ipaddr)) {
|
||||||
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: will not add non-unicast IP address to ARP cache\n"));
|
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: will not add non-unicast IP address to ARP cache\n"));
|
||||||
return ERR_ARG;
|
return ERR_ARG;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user