diff --git a/src/include/netif/bridgeif_opts.h b/src/include/netif/bridgeif_opts.h index 1ed62285..4ca08479 100644 --- a/src/include/netif/bridgeif_opts.h +++ b/src/include/netif/bridgeif_opts.h @@ -69,6 +69,8 @@ /** BRIDGEIF_MAX_PORTS: this is used to create a typedef used for forwarding * bit-fields: the number of bits required is this + 1 (for the internal/cpu port) * (63 is the maximum, resulting in an u64_t for the bit mask) + * ATTENTION: this controls the maximum number of the implementation only! + * The max. number of ports per bridge must still be passed via netif_add parameter! */ #ifndef BRIDGEIF_MAX_PORTS #define BRIDGEIF_MAX_PORTS 7 diff --git a/src/netif/bridgeif.c b/src/netif/bridgeif.c index 33b4eec1..c8b84f90 100644 --- a/src/netif/bridgeif.c +++ b/src/netif/bridgeif.c @@ -608,6 +608,8 @@ bridgeif_init(struct netif *netif) init_data = (bridgeif_initdata_t *)netif->state; LWIP_ASSERT("init_data != NULL", (init_data != NULL)); + LWIP_ASSERT("init_data->max_ports <= BRIDGEIF_MAX_PORTS", + init_data->max_ports <= BRIDGEIF_MAX_PORTS); alloc_len = sizeof(bridgeif_private_t) + (init_data->max_ports*sizeof(bridgeif_port_t) + (init_data->max_fdb_static_entries*sizeof(bridgeif_fdb_static_entry_t))); LWIP_DEBUGF(BRIDGEIF_DEBUG, ("bridgeif_init: allocating %d bytes for private data\n", (int)alloc_len));