Hi James,
On 10/21/20 1:44 PM, James Prestwood wrote:
The DHCP server can be enabled by enabling network configuration
with [General].EnableNetworkConfiguration. For now, the default
DHCP settings will be used. The only requirement is that the
AP network interface must have an IP set prior to calling Start().
---
src/ap.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 64 insertions(+), 6 deletions(-)
<snip>
+static bool ap_start_dhcp(struct ap_state *ap)
+{
+ uint32_t ifindex = netdev_get_ifindex(ap->netdev);
+ const struct l_settings *settings = iwd_get_config();
+ bool enabled = false;
+
+ /*
+ * Reusing [General].EnableNetworkConfiguration as a switch to enable
+ * DHCP server. If no value is found or it is false do not create a
+ * DHCP server.
+ */
+ if (!l_settings_get_bool(settings, "General",
+ "EnableNetworkConfiguration", &enabled))
+ return true;
+
+ if (!enabled)
+ return true;
+
+ ap->server = l_dhcp_server_new(ifindex);
+ if (!ap->server) {
+ l_error("Failed to create DHCP server on %u", ifindex);
+ return false;
+ }
Hmm, looks like the server is relying on some external entity to setup the IP
address. I thought we decided to have ap allocate this and set the address all
by itself?
Regards,
-Denis