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:20:04 +0000 (15:20 -0700)
commit92cf817bad93a29079788ebbc233a8df0afca241
treef28ae14dc9b23146a622554da9d6350931a21a83
parentb09265a6d4deaab2749ed135f0a8a1d45f0b9379
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