diff options
-rw-r--r-- | ryu/controller/ofp_event.py | 2 | ||||
-rw-r--r-- | 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 <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 |