This is an automated email from the ASF dual-hosted git repository. jerzy pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 5a97b303e73fdb8ab4ddbdb3e110a937abfb9ed5 Author: Jerzy Kasenberg <[email protected]> AuthorDate: Mon Feb 23 16:07:33 2026 +0100 net/lwip: Fix build with limited functionality LWIP now can be configured without DHCP, IPV4, IPV6. This simply marks some variable as (void) to avoid warnings when some code is not enabled. dhcp_start is only invoked when DHCP is selected for build. Signed-off-by: Jerzy Kasenberg <[email protected]> --- net/ip/lwip_mn/src/lwip_cli.c | 3 +++ net/ip/lwip_mn/src/lwip_socket.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/net/ip/lwip_mn/src/lwip_cli.c b/net/ip/lwip_mn/src/lwip_cli.c index 7200e2288..b622f725c 100644 --- a/net/ip/lwip_mn/src/lwip_cli.c +++ b/net/ip/lwip_mn/src/lwip_cli.c @@ -77,6 +77,7 @@ lwip_nif_up(const char *name) { struct netif *nif; err_t err; + (void)err; nif = netif_find(name); if (!nif) { @@ -89,8 +90,10 @@ lwip_nif_up(const char *name) nif->ip6_autoconfig_enabled = 1; netif_create_ip6_linklocal_address(nif, 1); #endif +#if LWIP_DHCP err = dhcp_start(nif); return lwip_err_to_mn_err(err); +#endif } return 0; } diff --git a/net/ip/lwip_mn/src/lwip_socket.c b/net/ip/lwip_mn/src/lwip_socket.c index 8066a06fe..a8417c185 100644 --- a/net/ip/lwip_mn/src/lwip_socket.c +++ b/net/ip/lwip_mn/src/lwip_socket.c @@ -89,6 +89,8 @@ lwip_mn_addr_to_addr(struct mn_sockaddr *ms, ip_addr_t *addr, uint16_t *port) { struct mn_sockaddr_in *msin; struct mn_sockaddr_in6 *msin6; + (void)msin; + (void)msin6; switch (ms->msa_family) { #if LWIP_IPV4 @@ -118,6 +120,8 @@ lwip_addr_to_mn_addr(struct mn_sockaddr *ms, const ip_addr_t *addr, { struct mn_sockaddr_in *msin; struct mn_sockaddr_in6 *msin6; + (void)msin; + (void)msin6; if (IP_IS_V4_VAL(*addr)) { ms->msa_family = MN_AF_INET; @@ -504,6 +508,11 @@ lwip_sendto(struct mn_socket *ms, struct os_mbuf *m, uint16_t port; int off; int rc; + (void)off; + (void)port; + (void)ip_addr; + (void)n; + (void)p; switch (s->ls_type) { #if LWIP_UDP @@ -633,6 +642,7 @@ lwip_setsockopt(struct mn_socket *ms, uint8_t level, uint8_t name, void *val) struct netif *nif; struct mn_mreq *mreq; int rc = MN_EPROTONOSUPPORT; + (void)nif; if (level == MN_SO_LEVEL) { switch (name) {
