Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Suggestion for OFPQueueGetConfigReply parser with queue.len=0 #118

Open
winstonhic opened this issue Oct 22, 2020 · 3 comments
Open

Suggestion for OFPQueueGetConfigReply parser with queue.len=0 #118

winstonhic opened this issue Oct 22, 2020 · 3 comments

Comments

@winstonhic
Copy link

winstonhic commented Oct 22, 2020

In /ryu/ofproto/ofproto_v1_3_parser.py about line=6073

If queue with len=0, while loop will not stop.

class OFPQueueGetConfigReply(MsgBase):
....
        offset = ofproto.OFP_QUEUE_GET_CONFIG_REPLY_SIZE
        while offset < msg_len:
            queue = OFPPacketQueue.parser(msg.buf, offset)
            msg.queues.append(queue)
            offset += queue.len
@literkid
Copy link

literkid commented Dec 9, 2020

The same questions are as follows:

In /ryu/ofproto/ofproto_v1_0_parser.py about line=2077

class OFPQueueGetConfigReply(MsgBase):
....
        offset = ofproto.OFP_QUEUE_GET_CONFIG_REPLY_SIZE
        while offset + ofproto.OFP_PACKET_QUEUE_SIZE <= msg_len:
            queue = OFPPacketQueue.parser(msg.buf, offset)
            msg.queues.append(queue)

            offset += queue.len

In /ryu/ofproto/ofproto_v1_2_parser.py about line=3187

class OFPQueueGetConfigReply(MsgBase):
....
        length = ofproto.OFP_QUEUE_GET_CONFIG_REPLY_SIZE
        offset = ofproto.OFP_QUEUE_GET_CONFIG_REPLY_SIZE
        while length < msg.msg_len:
            queue = OFPPacketQueue.parser(msg.buf, offset)
            msg.queues.append(queue)

            offset += queue.len
            length += queue.len

In /ryu/ofproto/ofproto_v1_4_parser.py about line=5763

class OFPBundleCtrlMsg(MsgBase):
....
        msg.bundle_id = bundle_id
        msg.type = type_
        msg.flags = flags
        msg.properties = []
        rest = msg.buf[ofproto.OFP_BUNDLE_CTRL_MSG_SIZE:]
        while rest:
            p, rest = OFPBundleProp.parse(rest)
            msg.properties.append(p)

In /ryu/ofproto/ofproto_v1_5_parser.py about line=6864

class OFPBundleCtrlMsg(MsgBase):
....
        msg.bundle_id = bundle_id
        msg.type = type_
        msg.flags = flags
        msg.properties = []
        rest = msg.buf[ofproto.OFP_BUNDLE_CTRL_MSG_SIZE:]
        while rest:
            p, rest = OFPBundleProp.parse(rest)
            msg.properties.append(p)

@facutuesca
Copy link

@gizmoguy Would you be open to a PR that fixes this issue?

@gizmoguy
Copy link
Member

Hi @facutuesca

Unfortunately I don't have enough free time right now to help review PRs for this project.

However we are looking for new maintainers, so if you or anyone else in the community are interested in being a maintainer and helping by reviewing/merging PRs let me know and I can grant you the appropriate access to the github.

Thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants