[ovs-dev] [PATCH] ofproto: Avoid removing rules from meter lists twice.
Ben Pfaff
blp at nicira.com
Thu Aug 29 23:50:28 UTC 2013
On Thu, Aug 29, 2013 at 04:48:59PM -0700, Jarno Rajahalme wrote:
>
> On Aug 29, 2013, at 4:23 PM, Ben Pfaff <blp at nicira.com> wrote:
>
> > Since the meter code was introduced, the oftable_remove_rule() function
> > (recently renamed oftable_remove_rule__()) has had two blocks of code to
> > remove a rule from its meter's list of rules that reference that meter.
> > This commit reduces that to one.
> >
> > Also modifies oftable_remove_rule__() to maintain the invariant that
> > 'rule' is in a meter's list if and only if
> > !list_is_empty(&rule->meter_list_node). I don't believe that that fixes
> > a real bug, but it seems like a good idea.
> >
> > (This seemed like a serious bug at first, but in fact list_remove() is
> > idempotent: calling it two times in a row has the same effect as calling
> > it once.)
>
> I think that this duplication crept in once the rule's 'meter_id' member was added.
> Thanks for fixing it!
>
> Jarno
>
> Acked-by: Jarno Rajahalme <jrajahalme at nicira.com
Thanks for the review. I applied this.
More information about the dev
mailing list