This counter was off by one, because port_num
should be less than STP_MAX_PORTS.
This caused an assert hit later in stp_get_port().
Issue: 13059
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
bitmap_set1(port_num_bitmap, port_idx);
port_s->port_num = port_idx;
} else {
- if (*port_num_counter > STP_MAX_PORTS) {
+ if (*port_num_counter >= STP_MAX_PORTS) {
VLOG_ERR("port %s: too many STP ports, disabling", port->name);
port_s->enable = false;
return;