summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYuichi Ito <ito.yuichi0@gmail.com>2014-01-07 11:32:40 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-01-07 18:11:01 +0900
commit7a10aafd39040fadec3ec525bce943059b5146dd (patch)
tree8c7359899f4cb6feaaeef7fbc284d928b13b29b3
parent79e2460c208d46564d9026d3f82dc91ffad3ec49 (diff)
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 <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/app/ofctl_rest.py5
1 files changed, 5 insertions, 0 deletions
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':