[OPNFLWPLUG-413] Incorrect logic in matchbuilder Created: 23/Apr/15  Updated: 27/Sep/21  Resolved: 22/Aug/16

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Anton Ivanov Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 3053

 Description   

This was masked by 3050 and thus not visible.

If you have a match with entriesBuilder.setHasMask(false);

(as in some testcases), the following logic in MatchCovertorImpl results in an invalid prefix (ip address instead of prefix)

if (maskMatchEntry != null) {
ipv6PrefixStr += PREFIX_SEPARATOR
+ MatchConvertorUtil.ipv6NetmaskArrayToCIDRValue(maskMatchEntry.getMask());
}

It should be:

if (maskMatchEntry != null) {
ipv6PrefixStr += PREFIX_SEPARATOR
+ MatchConvertorUtil.ipv6NetmaskArrayToCIDRValue(maskMatchEntry.getMask());
} else {
pv6PrefixStr += PREFIX_SEPARATOR + "128";
}

Similar for IPv4 prefixes.

I am quoting sources and lines from Helium. I have not looked at master which I suspect is likely to have the same bug.



 Comments   
Comment by Anton Ivanov [ 23/Apr/15 ]

There is a fix for v4 in the code already along the same lines. It is just missing for v6 because the regexp matching breakage in the generated Ipv6Prefix.java was not catching it.

Comment by Anton Ivanov [ 23/Apr/15 ]

FlowRemovedTranslator has the same problem.

In either case if the user originally specified the flow correctly (/128) this will result in opstate != confstate.

Comment by Anton Ivanov [ 23/Apr/15 ]

Gerrit:

https://git.opendaylight.org/gerrit/18917

Gerrit also has the IP addresses in incorrect non-RFC compliant notation fixed (which will probably break it). If it does not pass I will resubmit, but we have to fix those elsewhere. The current notation is bogus as it is pretty much guaranteed to result in a opstate != confstate situation

Comment by Abhijit Kumbhare [ 10/Nov/15 ]

Anton,

Are you planning to resubmit the fix? It says abandoned. Also added Michal Rehak to make sure he is aware of the patch.

Abhijit

Comment by Anton Ivanov [ 10/Nov/15 ]

I need to reread Li code. I think that was fixed as a part of a different gerrit.

Comment by Suvitha Balu [ 26/May/16 ]

Hope this issue is fixed - https://git.opendaylight.org/gerrit/#/c/19140/

Any reason why its open ?

Generated at Wed Feb 07 20:32:24 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.