Dell - Internal Use - Federal
PR created: https://github.com/osrg/ryu/pull/87

Synopsis: dpid with leading 0s would be truncated to less than 16 characters. 
This causes 404 errors on all URLs because the code would save the 15 character 
ID for the switch, but if you try to enter the 15 character ID, the dpid_lib 
DPID_PATTERN regex prevents you from sending the shortened string. My fix was 
to use the decimal integer, but zero fill it and save it as a string.

I also noticed that the Response object didn't specify a character endcoding 
which causes the error: "TypeError: You cannot set the body to a text value 
without a charset". I used the webob recommended fix and changed body to text 
so the default charset is used.

Grant

From: Curell, Grant
Sent: Wednesday, April 1, 2020 9:31 AM
To: 'Martin Frlin' <martin.fr...@gmail.com>
Cc: ryu-devel@lists.sourceforge.net
Subject: RE: [Ryu-devel] Bug Found in Ryu datapath_id implementation?


Dell - Internal Use - Federal
I noticed that as well, however, I used the example as is other than adding my 
own comments and moving everything into one file. It looks like this affects 
all the examples. I'm not sure it matters for all of them, but at least this 
one I'll fix it and PR.

Grant

From: Martin Frlin [mailto:martin.fr...@gmail.com]
Sent: Wednesday, April 1, 2020 8:19 AM
To: Curell, Grant <grant_cur...@federal.dell.com>
Cc: ryu-devel@lists.sourceforge.net
Subject: Re: [Ryu-devel] Bug Found in Ryu datapath_id implementation?

You are using decimal representation of dpid but you should be using hex. 
Switch dpid is 64 bit number and you can either look at it as an Integer (which 
is causing you problems) or you can represent it as a hex string (which you 
should).

This will do the trick for you:
>>> format(150013889525632, "x").zfill(16)
'0000886fd498b780'

V V sre., 1. apr. 2020 ob 05:35 je oseba Curell, Grant 
<grant.cur...@dell.com<mailto:grant.cur...@dell.com>> napisala:

Dell - Internal Use - Federal
I believe I have found a bug in how Ryu receives datapath_id. However, I am 
admittedly new to OpenFlow so I'm hesitant to say so with full confidence.

I have done a write up here: 
https://github.com/grantcurell/dell/tree/master/OpenFlow%20on%204112F-ON/bug

Can anyone else confirm?

Grant

_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net<mailto:Ryu-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/ryu-devel
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to