diff options
author | fumihiko kakuma <kakuma@valinux.co.jp> | 2015-06-29 16:00:59 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-06-29 22:09:16 +0900 |
commit | 25b3f23c2fa2604453547e8762fdccac8d1f2e11 (patch) | |
tree | a0aaf12ce1add32e748898dd6ba0ad0b53f781df | |
parent | 8c8be53de6fc84a97b838cd87ae2bfe334fb84e8 (diff) |
python3: Calculate the number of ports as integer
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_0_parser.py | 2 | ||||
-rw-r--r-- | ryu/ofproto/ofproto_v1_2_parser.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py b/ryu/ofproto/ofproto_v1_0_parser.py index 1582a695..e077a179 100644 --- a/ryu/ofproto/ofproto_v1_0_parser.py +++ b/ryu/ofproto/ofproto_v1_0_parser.py @@ -1686,7 +1686,7 @@ class OFPSwitchFeatures(MsgBase): ofproto.OFP_HEADER_SIZE) msg.ports = {} - n_ports = ((msg_len - ofproto.OFP_SWITCH_FEATURES_SIZE) / + n_ports = ((msg_len - ofproto.OFP_SWITCH_FEATURES_SIZE) // ofproto.OFP_PHY_PORT_SIZE) offset = ofproto.OFP_SWITCH_FEATURES_SIZE for _i in range(n_ports): diff --git a/ryu/ofproto/ofproto_v1_2_parser.py b/ryu/ofproto/ofproto_v1_2_parser.py index b528181f..60b5dedf 100644 --- a/ryu/ofproto/ofproto_v1_2_parser.py +++ b/ryu/ofproto/ofproto_v1_2_parser.py @@ -406,7 +406,7 @@ class OFPSwitchFeatures(MsgBase): ofproto.OFP_HEADER_SIZE) msg.ports = {} - n_ports = ((msg_len - ofproto.OFP_SWITCH_FEATURES_SIZE) / + n_ports = ((msg_len - ofproto.OFP_SWITCH_FEATURES_SIZE) // ofproto.OFP_PORT_SIZE) offset = ofproto.OFP_SWITCH_FEATURES_SIZE for i in range(n_ports): |