Hi,
buffer() seems to have been replaced with memoryview() in Python3.x.
This patch should fix the problem:
diff --git a/ryu/app/simple_switch_stp.py b/ryu/app/simple_switch_stp.py
index a86c8a5..bb2f667 100644
--- a/ryu/app/simple_switch_stp.py
+++ b/ryu/app/simple_switch_stp.py
@@ -82,7 +82,8 @@ class SimpleSwitchStp(app_manager.RyuApp):
datapath = msg.datapath
ofproto = datapath.ofproto
- dst, src, _eth_type = struct.unpack_from('!6s6sH',
buffer(msg.data), 0)
+ dst, src, _eth_type = struct.unpack_from(
+ '!6s6sH', memoryview(msg.data), 0)
dpid = datapath.id
self.mac_to_port.setdefault(dpid, {})
Could you try this?
Thanks,
Fujimoto
On 2018年03月14日 20:53, knet solutions wrote:
In Python 3.5,
STP Application (ryu.app.simple_switch_stp) is not working.
[STP][INFO] dpid=0000000000000002: [port=2] NON_DESIGNATED_PORT / BLOCK
[STP][INFO] dpid=0000000000000002: [port=3] ROOT_PORT / FORWARD
SimpleSwitchStp: Exception occurred during handler processing.
Backtrace from offending handler [packet_in_handler] servicing event
[EventPacketIn] follows.
Traceback (most recent call last):
File
"/usr/local/lib/python3.5/dist-packages/ryu/base/app_manager.py", line
290, in _event_loop
handler(ev)
File
"/usr/local/lib/python3.5/dist-packages/ryu/app/simple_switch_stp.py",
line 85, in packet_in_handler
dst, src, _eth_type = struct.unpack_from('!6s6sH',
buffer(msg.data), 0)
NameError: name 'buffer' is not defined
But in 2.7, it works perfectly.
--
*/Regards,
/*
*/Suresh.
/*
*/Knet solutions./*
https://github.com/knetsolutions/KNet
http://knet-topology-builder.readthedocs.io/
http://knetsolutions.in/
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel