Skip to content

Commit

Permalink
stplib.py: Should wildcard non-relevant bits in the mask field of por…
Browse files Browse the repository at this point in the history
…t mod message for OpenFlow 1.2+.

Signed-off-by: FUJITA Tomonori <[email protected]>
  • Loading branch information
fortitudepub authored and fujita committed Oct 20, 2014
1 parent 9ea360f commit ac4c9cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ryu/lib/stplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,10 @@ def set_port_status(self, port, state):
config = {ofproto_v1_2: PORT_CONFIG_V1_2,
ofproto_v1_3: PORT_CONFIG_V1_3}

mask = 0b1111111
# Only turn on the relevant bits defined on OpenFlow 1.2+, otherwise
# some switch that follows the specification strictly will report
# OFPPMFC_BAD_CONFIG error.
mask = 0b1100101
msg = parser.OFPPortMod(self.dp, port.port_no, port.hw_addr,
config[ofp][state], mask, port.advertised)
self.dp.send_msg(msg)
Expand Down

0 comments on commit ac4c9cc

Please sign in to comment.