mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 11:40:18 +01:00
extmod/modnetwork: Increase max hostname length to 32.
This changes from the previous limit of 15 characters. Although DHCP and mDNS allow for up to 63, ESP32 and ESP8266 only allow 32, so this seems like a reasonable limit to enforce across all ports (and avoids wasting the additional memory). Also clarifies that `MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN` does not include the null terminator (which was unclear before). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
committed by
Damien George
parent
d6c55a40fe
commit
b329fdcb73
@@ -56,10 +56,12 @@
|
||||
extern char mod_network_country_code[2];
|
||||
|
||||
#ifndef MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN
|
||||
#define MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN (16)
|
||||
// Doesn't include the null terminator.
|
||||
#define MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN (32)
|
||||
#endif
|
||||
|
||||
extern char mod_network_hostname[MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN];
|
||||
// This is a null-terminated string.
|
||||
extern char mod_network_hostname[MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN + 1];
|
||||
|
||||
#if MICROPY_PY_LWIP
|
||||
struct netif;
|
||||
|
||||
Reference in New Issue
Block a user