Skip to content

Commit

Permalink
Linux: Don't define CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD by default (#3…
Browse files Browse the repository at this point in the history
…1053)

... and compile out the related code if it is not defined.
  • Loading branch information
ksperling-apple authored and pull[bot] committed Apr 11, 2024
1 parent bd3903b commit b065298
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/platform/Linux/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@
#include <platform/internal/GenericConnectivityManagerImpl_WiFi.ipp>
#endif

#ifndef CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD
#define CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD "dhclient -nw %s"
#endif

using namespace ::chip;
using namespace ::chip::TLV;
using namespace ::chip::DeviceLayer;
Expand Down Expand Up @@ -1139,6 +1135,10 @@ void ConnectivityManagerImpl::PostNetworkConnect()
}
}

#if defined(CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD)
// CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD can be defined to a command pattern
// to run once the network has been connected, with a %s placeholder for the
// interface name. E.g. "dhclient -nw %s"
// Run dhclient for IP on WiFi.
// TODO: The wifi can be managed by networkmanager on linux so we don't have to care about this.
char cmdBuffer[128];
Expand All @@ -1152,6 +1152,7 @@ void ConnectivityManagerImpl::PostNetworkConnect()
{
ChipLogProgress(DeviceLayer, "dhclient is running on the %s interface.", sWiFiIfName);
}
#endif // defined(CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD)
}

CHIP_ERROR ConnectivityManagerImpl::CommitConfig()
Expand Down

0 comments on commit b065298

Please sign in to comment.