From 4152e5d229b2c9265a0367e2549ff6ecba9c7440 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 22 Nov 2012 16:33:21 +0900 Subject: 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 --- ryu/controller/ofp_event.py | 2 +- ryu/controller/ofp_handler.py | 8 +++++++- 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 # # 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 -- cgit v1.2.3