Skip to content

Commit

Permalink
Remove dead !HAVE_LWIP_UDP_BIND_NETIF configuration (project-chip#31045)
Browse files Browse the repository at this point in the history
* Remove dead !HAVE_LWIP_UDP_BIND_NETIF configuration

This define came in with the initial import, but we never provided any
way to turn it off. Remove that case as dead code.

* Remove LWIP_NO_STDINT_H on Android

Android doesn't use lwIP, and the NDK has stdint.h, so this seems pretty
strange. Remove it.
  • Loading branch information
mspang authored Dec 15, 2023
1 parent 23add0b commit 0a5f3d3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
8 changes: 0 additions & 8 deletions src/inet/UDPEndPointImplLwIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

#include <inet/UDPEndPointImplLwIP.h>

#if CHIP_HAVE_CONFIG_H
#include <lwip/lwip_buildconfig.h> // nogncheck
#endif // CHIP_HAVE_CONFIG_H

#if INET_CONFIG_ENABLE_IPV4
#include <lwip/igmp.h>
#endif // INET_CONFIG_ENABLE_IPV4
Expand Down Expand Up @@ -121,13 +117,9 @@ CHIP_ERROR UDPEndPointImplLwIP::LwIPBindInterface(struct udp_pcb * aUDP, Interfa

InterfaceId UDPEndPointImplLwIP::GetBoundInterface() const
{
#if HAVE_LWIP_UDP_BIND_NETIF
struct netif * netif;
RunOnTCPIP([this, &netif]() { netif = netif_get_by_index(mUDP->netif_idx); });
return InterfaceId(netif);
#else
return InterfaceId(mUDP->intf_filter);
#endif
}

uint16_t UDPEndPointImplLwIP::GetBoundPort() const
Expand Down
7 changes: 2 additions & 5 deletions src/lwip/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,13 @@ buildconfig_header("lwip_buildconfig") {
header = "lwip_buildconfig.h"
header_dir = "lwip"

defines = [ "HAVE_LWIP_UDP_BIND_NETIF=1" ]
defines = []

if (lwip_platform != "external") {
if (lwip_debug) {
# Automatically enable LWIP_DEBUG for internal is_debug builds.
defines += [ "LWIP_DEBUG=1" ]
}

if (current_os == "android") {
defines += [ "LWIP_NO_STDINT_H=1" ]
}
}
}

Expand Down
12 changes: 0 additions & 12 deletions src/platform/mt793x/lwip/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ declare_args() {
import("//build_overrides/mt793x_sdk.gni")
import("${mt793x_sdk_build_root}/mt793x_sdk.gni")

#buildconfig_header("lwip_buildconfig") {
# header = "lwip_buildconfig.h"
# header_dir = "lwip"
#
# defines = [ "HAVE_LWIP_UDP_BIND_NETIF=1" ]
# if (lwip_platform != "external") {
# if (current_os == "android") {
# defines += [ "LWIP_NO_STDINT_H=1" ]
# }
# }
#}

config("lwip_config") {
include_dirs = [
"${mt793x_sdk_root}/project/mt7933_hdk/apps/${mt793x_project_name}/inc",
Expand Down

0 comments on commit 0a5f3d3

Please sign in to comment.