On Wed, Sep 04, 2013 at 04:31:35PM -0700, Ben Pfaff wrote:
> On Mon, Sep 02, 2013 at 11:28:10AM +0900, Simon Horman wrote:
> > struct ofputil_group_stats has an arbitrary limit
> > of 16 buckets for which it can record statistics.
> > However the code does not appear to enforce this
> > limit and it seems to me that the code could overflow.
> > 
> > This patch aims to remove the arbitrary limit by
> > removing the 'bucket_stats' field from struct ofputil_group_stats
> > and instead allowing an instance of that structure to be
> > followed by an any number of struct bucket_counter.
> > 
> > Signed-off-by: Simon Horman <[email protected]>
> 
> I tend to regard data structures that end with an explicit or (as
> here) implicit variable-length array as somewhat confusing, at least
> more so than simpler solutions.  Thus, I use them as an optimization
> that one does in cases where time or space is at a premium.  But I
> don't think that either is a problem here, so I would prefer to avoid
> using one.
> 
> Would you mind, therefore, recasting this in terms of an explicit
> pointer, something like:
> 
>      uint32_t n_buckets;
>      struct bucket_counter *bucket_stats;

Hi Ben,

no I don't mind at all. I'll respin the patch accordingly.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to