From 7a10aafd39040fadec3ec525bce943059b5146dd Mon Sep 17 00:00:00 2001 From: Yuichi Ito Date: Tue, 7 Jan 2014 11:32:40 +0900 Subject: [PATCH] ofctl_rest: fix mod_meter_entry in OpenFlow1.0/1.2 mod_meter_entry causes the following error when the protocol version is 1.0 or 1.2. AttributeError: 'module' object has no attribute 'OFPMC_ADD' this patch fixes this problem. Signed-off-by: Yuichi Ito Signed-off-by: FUJITA Tomonori --- ryu/app/ofctl_rest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ryu/app/ofctl_rest.py b/ryu/app/ofctl_rest.py index 8ab53f98..e108b036 100644 --- a/ryu/app/ofctl_rest.py +++ b/ryu/app/ofctl_rest.py @@ -256,6 +256,11 @@ class StatsController(ControllerBase): if dp is None: return Response(status=404) + if dp.ofproto.OFP_VERSION == ofproto_v1_0.OFP_VERSION or \ + dp.ofproto.OFP_VERSION == ofproto_v1_2.OFP_VERSION: + LOG.debug('Unsupported OF protocol') + return Response(status=501) + if cmd == 'add': cmd = dp.ofproto.OFPMC_ADD elif cmd == 'modify':