Skip to content

add dhcp_hostname config for esp32 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from

Conversation

andrey-hinkov
Copy link

No description provided.

@@ -126,6 +137,12 @@ bool mgos_ethernet_init(void) {
return false;
}

ret = esp32_set_host_name(mgos_sys_config_get_eth());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would set host name only if it is explicitely set in the configuration:

if (mgos_sys_config_get_eth_dhcp_hostname() != NULL &&
    esp_netif_set_hostname(esp_netif_get_handle_from_ifkey("ETH_DEF"), 
      mgos_sys_config_get_eth_dhcp_hostname()) != ESP_OK) {
  LOG(LL_ERROR, ("ETH: Failed to set host name"));
  goto out;
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now, thanks for the advice. master...ALLTERCO:master

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the function can be inlined since it's only used once. you already have the netif handle in eth_if here

@kzyapkov
Copy link

kzyapkov commented Feb 10, 2021

Strangely, pushing new versions of the commit doesn't reflect this pull request. Let's close this, I'll open a fresh one from a branch in our fork.

@cpq
Copy link
Contributor

cpq commented Feb 10, 2021

Closing this, as #6 was pushed.

@cpq cpq closed this Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants