summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-11-22 16:33:21 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-11-23 11:38:05 +0900
commit4152e5d229b2c9265a0367e2549ff6ecba9c7440 (patch)
tree6be4c7a49f0c773c8d4adde5de3f61d671035bb0
parent2bd4e3003c27a5b53d9c182d1d87b23bc1b7800d (diff)
Add workaround to switch_features_handler for OF1.3
hacky workaround, will be removed. OF1.3 doesn't have ports. An application should not depend on them. But there might be such bad applications so let's keep this workaround for while. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/controller/ofp_event.py2
-rw-r--r--ryu/controller/ofp_handler.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/ryu/controller/ofp_event.py b/ryu/controller/ofp_event.py
index 41d0b406..cb2edeba 100644
--- a/ryu/controller/ofp_event.py
+++ b/ryu/controller/ofp_event.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
+# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/ryu/controller/ofp_handler.py b/ryu/controller/ofp_handler.py
index eee75b2b..63f888a6 100644
--- a/ryu/controller/ofp_handler.py
+++ b/ryu/controller/ofp_handler.py
@@ -82,7 +82,13 @@ class OFPHandler(app_manager.RyuApp):
LOG.debug('switch features ev %s', msg)
datapath.id = msg.datapath_id
- datapath.ports = msg.ports
+
+ # hacky workaround, will be removed. OF1.3 doesn't have
+ # ports. An application should not depend on them. But there
+ # might be such bad applications so keep this workaround for
+ # while.
+ if datapath.ofproto.OFP_VERSION < 0x04:
+ datapath.ports = msg.ports
ofproto = datapath.ofproto
ofproto_parser = datapath.ofproto_parser