From ac4c9cc9d86796f36c5d2cfa26a2780e1f4fc383 Mon Sep 17 00:00:00 2001 From: "fortitude.zhang" Date: Sun, 19 Oct 2014 23:51:01 +0800 Subject: [PATCH] stplib.py: Should wildcard non-relevant bits in the mask field of port mod message for OpenFlow 1.2+. Signed-off-by: FUJITA Tomonori --- ryu/lib/stplib.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ryu/lib/stplib.py b/ryu/lib/stplib.py index 8855cabe0..9fbdece07 100644 --- a/ryu/lib/stplib.py +++ b/ryu/lib/stplib.py @@ -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)