On Mon, Jul 23, 2012 at 02:57:24PM +0900, Isaku Yamahata wrote:
> On Fri, Jul 20, 2012 at 04:25:25PM -0700, Ben Pfaff wrote:
> > diff --git a/lib/flow.c b/lib/flow.c
> > index a5076bb..7b50b0b 100644
> > --- a/lib/flow.c
> > +++ b/lib/flow.c
> 
> ...snip...
> 
> > +/* Initializes 'dst' as the bit-wise "and" of 'a' and 'b'.
> > + *
> > + * The caller must provide room for FLOW_U32S "uint32_t"s in 'storage', 
> > for use
> > + * by 'dst'.  The caller must *not* free 'dst' with minimask_destroy(). */
> > +void
> > +minimask_combine(struct minimask *dst_,
> > +                 const struct minimask *a_, const struct minimask *b_,
> > +                 uint32_t storage[FLOW_U32S])
> > +{
> > +    struct miniflow *dst = &dst_->masks;
> > +    const struct miniflow *a = &a_->masks;
> > +    const struct miniflow *b = &b_->masks;
> > +    int i, n;
> > +
> > +    n = 0;
> > +    dst->values = storage;
> > +    for (i = 0; i < MINI_N_MAPS; i++) {
> > +        uint32_t map = a->map[i] & b->map[i];
> > +
> > +        dst->map[i] = 0;
> > +        for (map = dst->map[i]; map; map = zero_rightmost_1bit(map)) {
>                 ^^^^^^^^^^^^^^^^^
>                 map = a->map[i] & b->map[i];
> typo.

Thank you very much.  I folded this in:

diff --git a/lib/flow.c b/lib/flow.c
index 7b50b0b..9553f34 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -1218,10 +1218,11 @@ minimask_combine(struct minimask *dst_,
     n = 0;
     dst->values = storage;
     for (i = 0; i < MINI_N_MAPS; i++) {
-        uint32_t map = a->map[i] & b->map[i];
+        uint32_t map;
 
         dst->map[i] = 0;
-        for (map = dst->map[i]; map; map = zero_rightmost_1bit(map)) {
+        for (map = a->map[i] & b->map[i]; map;
+             map = zero_rightmost_1bit(map)) {
             int ofs = raw_ctz(map) + i * 32;
             uint32_t mask = miniflow_get(a, ofs) & miniflow_get(b, ofs);
 
How did you find this?  Reading code?  If you have a test case that
detects it, I'd be very happy to add that to the unit tests.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to