[prev in list] [next in list] [prev in thread] [next in thread]
List: openvswitch-dev
Subject: [ovs-dev] [PATCH 1/2] test-classifier: Ensure priority is not negative.
From: jrajahalme () nicira ! com (Jarno Rajahalme)
Date: 2014-10-31 23:30:51
Message-ID: FCE9B341-5673-456E-A363-10741DEDFA9E () nicira ! com
[Download RAW message or body]
On Oct 31, 2014, at 4:06 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Fri, Oct 31, 2014 at 04:02:23PM -0700, Jarno Rajahalme wrote:
>>
>> On Oct 31, 2014, at 2:24 PM, Ben Pfaff <blp at nicira.com> wrote:
>>
>>> On Fri, Oct 31, 2014 at 02:17:56PM -0700, Jarno Rajahalme wrote:
>>>> Classifier users should not use negative priorities.
>>>>
>>>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
>>>
>>> The only priority that the classifier can't handle properly is
>>> INT_MIN. Unfortunately, that's also the one priority that this patch
>>> doesn't fix (since -INT_MIN == INT_MIN, at least on the system we care
>>> about).
>>>
>>
>> Oops, did not think of that!
>>
>>>> + cls_rule_init(&rule->cls_rule, &match, wc_fields
>>>> + ? (priority < 0 ? -priority: priority)
>>>> + : INT_MAX);
>>
>> How about this:
>>
>> cls_rule_init(&rule->cls_rule, &match, wc_fields
>> ? (priority == INT_MIN ? priority + 1 : priority)
>> : INT_MAX);
>
> Acked-by: Ben Pfaff <blp at nicira.com>
Pushed, thanks (but I forgot to add your Acked-by to the commit message, sorry!)
Jarno
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic