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>
This commit is contained in:
FUJITA Tomonori 2012-11-22 16:33:21 +09:00
parent 2bd4e3003c
commit 4152e5d229
2 changed files with 8 additions and 2 deletions

View File

@ -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");

View File

@ -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