Hi Matt,

I'm sorry I didn't explain it enough.
I commented some on your patch.

"except exception.OFPMalformedMessage" is not enough for msg_parser(), I guess.
msg_parser() will raise more various exceptions (e.g., struct.error) and I think
we need to catch these exceptions, otherwise controller-switch connection can be
unstable.

Thanks,
Iwase

On 2017年10月26日 10:24, Matthew Moskowitz wrote:
Hi Iwase,

Just to clarify, is this patch accepted?

Matt

On Mon, Oct 9, 2017 at 10:25 PM, Iwase Yusuke <iwase.yusu...@gmail.com <mailto:iwase.yusu...@gmail.com>> wrote:

    Hi Matt,

    Thank you for submitting your patch!


        diff --git a/ryu/ofproto/ofproto_parser.py 
b/ryu/ofproto/ofproto_parser.py
        index e2300558..4dd7f88d 100644
        --- a/ryu/ofproto/ofproto_parser.py
        +++ b/ryu/ofproto/ofproto_parser.py
        @@ -67,7 +67,7 @@ def msg(datapath, version, msg_type, msg_len, xid, 
buf):
                  msg = msg_parser(datapath, version, msg_type, msg_len, xid, 
buf)
              except exception.OFPTruncatedMessage as e:
                  raise e
        -    except:
        +    except exception.OFPMalformedMessage:
                  LOG.exception(
                      'Encountered an error while parsing OpenFlow packet from 
switch. '
                      'This implies the switch sent a malformed OpenFlow 
packet. '


    As you said, this "except" statement is too broad but left it with the 
historical reason IIRC.
    "msg_parser", which will be "parser" method of each message class in 
"ofproto_v1_*_parser.py",
    can raise too various exceptions (mostly "struct.error", I guess), so except 
"Exception" here.

    We need detect all exception types, if specify exception class.

    Thanks,
    Iwase



    On 2017年10月07日 12:17, Matthew Moskowitz wrote:

        Hello,

        I found a misleading error message in a try except block. This message 
should only be
        printed in the case of a poorly formed openflow message, however it was 
being printed for
        almost every exception. Patch is attached.

        Thanks,
        Matt


        
------------------------------------------------------------------------------
        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 <mailto:Ryu-devel@lists.sourceforge.net>
        https://lists.sourceforge.net/lists/listinfo/ryu-devel
        <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


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

Reply via email to