From 8d89b16ea4bae5b0df1080f0c3b8ea4a751f40ea Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Sat, 17 Jan 2026 00:24:40 +0000 Subject: 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 Reviewed-by: Jerome Forissier --- cmd/lwip/ping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/lwip/ping.c b/cmd/lwip/ping.c index 6d090fc530d..fc4cf7bde5f 100644 --- a/cmd/lwip/ping.c +++ b/cmd/lwip/ping.c @@ -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))) && -- cgit v1.2.3