net: lwip: Use ipaddr helpers

The ip_addr_t of lwIP has support for both IPv6 and IPv4 addresses.
Some lwIP commans is directly accessing the internal addr field of the
ip_addr_t instead of using ipaddr helper functions.

Change to use ipaddr helper functions where appropriate to remove direct
access of the internal addr field. Also change a few instances from ip4
to the version less ipaddr helpers.

There is no intended functional change, besides the change from using
ip4 addr helper to using version less ipaddr helper.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
This commit is contained in:
Jonas Karlman
2026-01-17 00:24:40 +00:00
committed by Jerome Forissier
parent 3299bffc7c
commit 8d89b16ea4
5 changed files with 10 additions and 13 deletions

View File

@@ -35,7 +35,7 @@ static u8_t ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p,
struct ping_ctx *ctx = arg;
struct icmp_echo_hdr *iecho = ctx->iecho;
if (addr->addr != ctx->target.addr)
if (!ip_addr_eq(addr, &ctx->target))
return 0;
if ((p->tot_len >= (IP_HLEN + sizeof(struct icmp_echo_hdr))) &&