-
Notifications
You must be signed in to change notification settings - Fork 4
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 bug in IP wildcarding. #172
Conversation
According to the OpenFlow specification, the mask on nw_src and nw_dst fields is not a description of how many bits to match, but rather a description of how many bits to mask. Hence, /0 is exact match and /32 is a total wildcard. We had this backwards in the OpenFlow0x01 controller. This pull requests fixes the bug.
Whitespace. |
The line-wrapping introduced more whitespace errors. There are also tabs:
Adding the pre-commit hook will notify you of stuff like this before you commit:
|
By the way: @mcanini @fugitifduck I only fixed 1.0 since it's the code I'm most familiar with. Do you know if 1.3 and 1.4 might also have the same bug? -N |
@jnfoster I think, line 20 of OpenFlow0x0(4|5)_Core.ml is code like in 0x01. But, starting from 0x02, nwsrc is include in Oxm, and the mask is a CIDR mask (where /32 is exact and /0 is wildcard). |
Cool. So, just to make sure I understand, they switched to CIDR conventions so there shouldn't be a bug in our 1.3/1.4 code? |
I think (p52 of OF1.3.3 spec) |
Excellent. Thanks! |
Actually I am not sure that this won't be a bug in 1.3/1.4 too. Quoting the specs (1.3.3): "Each 1-bit in oxm_mask constrains the OXM TLV to match only packets in which the corresponding bit of the field equals the the corresponding bit in oxm_value. Each 0-bit in oxm_mask places no constraint on the corresponding bit in the field." So, in my interpretation, something link 192.168.1.0/24 means that the mask has to be |
So, after a bit of investigation, indeed it seems that the bug affects OF1.3/1.4 too. |
Fantastic! Great to hear. -N On Fri, Sep 5, 2014 at 10:58 AM, Marco Canini notifications@github.com
|
This pull requests fixes a bug in the calculation of IP masks in OpenFlow 0x01.