netif: Verify NETIF_MAX_HWADDR_LEN on netif add

This commit is contained in:
Erik Ekman
2026-06-01 21:45:51 +02:00
parent ab2f69c7d8
commit 0f8331d47b

View File

@@ -388,6 +388,8 @@ netif_add(struct netif *netif,
if (init(netif) != ERR_OK) { if (init(netif) != ERR_OK) {
return NULL; return NULL;
} }
LWIP_ASSERT("netif->hwaddr_len <= NETIF_MAX_HWADDR_LEN",
(netif->hwaddr_len <= NETIF_MAX_HWADDR_LEN));
#if LWIP_IPV6 && LWIP_ND6_ALLOW_RA_UPDATES #if LWIP_IPV6 && LWIP_ND6_ALLOW_RA_UPDATES
/* Initialize the MTU for IPv6 to the one set by the netif driver. /* Initialize the MTU for IPv6 to the one set by the netif driver.
This can be updated later by RA. */ This can be updated later by RA. */