[ovs-dev] [PATCH 3/3] extract-ofp-fields: Detect duplicate fields.

Joe Stringer joestringer at nicira.com
Wed May 20 21:42:28 UTC 2015


On 20 May 2015 at 14:33, YAMAMOTO Takashi <yamamoto at valinux.co.jp> wrote:
>> -    class_ = oxm_name_to_class(name)
>> +    prefix, class_ = oxm_name_to_class(name)
>>      if class_ is None:
>>          fatal("unknown OXM class for %s" % name)
>>      oxm_vendor, oxm_class = class_
>>
>> +    if prefix in match_types:
>> +        if oxm_type in match_types[prefix]:
>> +            fatal("duplicate match type for %s (conflicts with %s)" %
>> +                  (name, match_types[prefix][oxm_type]))
>> +    else:
>> +        match_types[prefix] = dict()
>> +    match_types[prefix][oxm_type] = name
>
> why don't you just use _class instead of prefix?

Good catch, was leftover from when I was first figuring out how this
worked. Using "prefix" is also error prone, as it hides the existing
variable of that name. I'll send v2.



More information about the dev mailing list