From: Ansis Atteka Date: Tue, 21 Aug 2012 23:48:36 +0000 (-0700) Subject: stp: port_no counter is off by one X-Git-Tag: sliver-openvswitch-1.8.90-0~48^2~17 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=6019f124107ff8f86ecc1dc65fde64cf935ac7d8 stp: port_no counter is off by one 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 Reported-by: Ram Jothikumar Acked-by: Ethan Jackson --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index bd8e772af..1fbbe32ac 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -937,7 +937,7 @@ port_configure_stp(const struct ofproto *ofproto, struct port *port, 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;