Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix groupmod length calculation #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

harmjan
Copy link
Contributor

@harmjan harmjan commented Feb 21, 2017

I apparently am doing something weird where I receive packets, edit them,and then send them out again. If a GroupMod already contains buckets will the length be incorrect after replacing them with new buckets.
I think this problem occurs in every function that contains "this->length_ +=", isn't a constructor and doesn't contain the string "add" in the function name. I'm not going to try and change all of them.
I also looked at the of13::FlowMod class since I also use that one a lot, the functions of13::FlowMod::match and of13::FlowMod::instructions technically have the same problem but the length of the of13::FlowMod packet is recalculated in the pack function so there is no benefit to changing them.

@ederlf
Copy link
Member

ederlf commented Feb 23, 2017

I did not consider the possibility to replace objects from a class because I did not foresee message objects living after being sent or processed.

The pull request may solve the issue but it is just a quick workaround, so I will not merge as it is better to think about a different approach in the case of replacing members of different sizes in a message.

Thanks for pointing out the problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants