ofproto-dpif-xlate: Fix confusion between "no stp port" and "stp port 0".
authorAlex Wang <alexw@nicira.com>
Wed, 4 Sep 2013 22:21:15 +0000 (15:21 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 4 Sep 2013 22:44:01 +0000 (15:44 -0700)
commitc9dad52a818693e5d5eb75891db9e6f0a5053886
tree41a6ee3dd1fba9c1e3df8ee028132b8d423a90ed
parente374f18644b62bf893d1082f2965c33978c01e46
ofproto-dpif-xlate: Fix confusion between "no stp port" and "stp port 0".

Commit 9d189a50e (ofproto-dpif-xlate: Pull STP xlation into
ofproto-dpif-xlate.) introduced the bug that considers 'stp_port_no'
of 0 as stp disabled on the port.  However 'stp_port_no' is
actually the index of the stp struct's port array and ranges
between [0, STP_MAX_PORTS).  So the bug allows the blocked
port keep transmitting packets and generates loop.

This commit fixes this bug.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto-dpif.c