summaryrefslogtreecommitdiff
path: root/lwip/lwip-util.c
AgeCommit message (Collapse)Author
5 dayslwip: allow setting an zero or broadcast addressJoan Lledó
After DHCPRELEASE, DHCP client sends a SIOCSIFADDR to set the interface address to 0.0.0.0. This is not accepted by our IP validator `ipv4config_is_valid()`. I think this use case is legit so this commit makes the translator accept 0.0.0.0 as a valid address. This assumes that a client trying to set IP to 0.0.0.0 is in fact trying to remove the IP from the interface. Then it sets all fields to NONE, in order to pass the validation. * lwip/lwip-util.c: `configure_device`: Add the exception for 0.0.0.0 and 255.255.255.255. Message-ID: <20250729155244.7976-2-jlledom@mailfence.com>
2023-12-02lwip: Allocate the loopback netif by defaultJoan Lledó
The translator received a null `netif_list` during initialization, this caused a few bugs. When started without parameters, the translator didn't add any new interface to `netif_list`, and that broke any subsequent fsysopts over the translator, as the stack was being initialized again instead of being reconfigured. DHCP was broken because the translator is usually installed without parameters, which are supposed to be added by the DHCP client through fsysopts. The absence of an allocated `netif_list` also prevented configuring a loopback interface. After these changes, starting the translator always allocates one interface and configures it as loopback. Message-ID: <20231202101401.11542-2-jlledom@mailfence.com>
2023-04-03Modernize code by removing use of old style definitions.Flavio Cruz
Also add -Werror=old-style-definition to enforce new code. Message-Id: <ZBZ+8xf7GHy2RT/h@jupiter.tail36e24.ts.net>
2019-05-11lwip: Fix bug: Error handling on configure_device()Joan Lledó
* lwip/lwip-util.c: * EINVAL was never being returned. * Return error code for tcpip_callback() as errno. Message-Id: <20190511093202.9763-2-jlledom@member.fsf.org>
2019-05-02lwip: Error handling when calling update_if()Joan Lledó
* lwip/lwip-util.c: * Check for errors when calling update_if() inside a thread-safe context. Message-Id: <20190502095502.10926-4-jlledom@member.fsf.org>
2019-03-31lwip: Stop using netifapi.Joan Lledó
Use tcpip_callback() to reconfigure interfaces in a thread-safe context instead. * lwip/lwip-util.c: * Replace all netifapi calls by their non-netifapi versions. * update_ifs() is called through tcpip_callback(). * lwip/options.c: * Call init_fs() through tcpip_callback(). * lwip/port/netif/ifcommon.c: * Replace all netifapi calls by their non-netifapi versions. Message-Id: <20190331175541.7095-5-jlledom@member.fsf.org>
2019-03-31lwip: Fix wrong error checksJoan Lledó
* lwip/lwip-util.c: init_ifs(): * Check for the value of ifc instead of in->dev_name * lwip/port/netif/ifcommon.c: * if_init(), if_terminate(): Check for null on ifc instead of netif Message-Id: <20190331175541.7095-2-jlledom@member.fsf.org>
2018-05-01Include required sockets headersJoan Lledó
* lwip/iioctl-ops.c: Include <lwip/inet.h>. * lwip/lwip-util.c: Likewise. * lwip/pfinet-ops.c: Include <lwip/sockets.h> and <lwip/inet.h>. * lwip/port/netif/hurdethif.c: Likewise.
2017-12-18lwip: Add LwIP-based TCP/IP translatorJoan Lledó
* Makefile (prog-subdirs): Add lwip. * config.make.in (HAVE_LIBLWIP, liblwip_CFLAGS, liblwip_LIBS): Define variables. * configure.ac: Check for liblwip. * lwip/: New directory.