Skip to content
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

Hostname advertised to DHCP is truncated at 20 characters #774

Closed
wsw70 opened this issue Apr 9, 2018 · 5 comments
Closed

Hostname advertised to DHCP is truncated at 20 characters #774

wsw70 opened this issue Apr 9, 2018 · 5 comments

Comments

@wsw70
Copy link

wsw70 commented Apr 9, 2018

A hostname defined as chambre1-lampe_bureau on ESPurna is registered by my DHCP as chambre1-lampe_burea (the last u is missing).

ESPurna apparently cuts the advertised hostname at 20 characters: below is a tcpdump of the DHCP Request from the device to the DHCP server:

image

Is there a particular reason for this? (the DHCP server can handle longer hostnames, I see all kind of android-97d6cbda92c6fgb56 kind of entries).

The only place where I see this cutoff is in DHCP, in other places (web interface, MQTT telemetry data) the hostname is complete.

@wsw70 wsw70 changed the title Is there a length limit on the hostname advertised to DHCP? Hostname advertised to DHCP is truncated at 20 characters Apr 9, 2018
@mcspr
Copy link
Collaborator

mcspr commented Apr 9, 2018

Yep, thats a bug. Limit should be 32 because hostname is linked to SSID.

20 limit comes from justwifi
From espurna side 847e1e6 can be reverted and adapted to the new limit.

@Skaronator
Copy link
Contributor

Skaronator commented Apr 9, 2018

20 limit comes from justwifi

Take a look who wrote this code. :P It is probably better to increase this to 30 or 40 chars than reverting 847e1e6

@mcspr
Copy link
Collaborator

mcspr commented Apr 10, 2018

@Skaronator What I mean is - it is not possible to go outside 32 with current setup. Access point SSID cannot be longer than that.

Underlying arduino methods already have the limit check for STA hostname and AP SSID (even better - 31 chars :/) so required justwifi change should probably be as easy as changing buffer length. AP must still work even truncated. WebUI though should enforce the limit.

@xoseperez
Copy link
Owner

Staged for release. Closing.

@wsw70
Copy link
Author

wsw70 commented May 18, 2018

Confirmed that the name is not truncated anymore. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants