[ovs-dev] [PATCH] ofp-util: Fix validation of OFPAT_SET_VLAN_PCP actions.

Ben Pfaff blp at nicira.com
Wed May 4 23:21:33 UTC 2011


The error would have been something like this:

    warning: incorrect type in assignment (different base types)
       expected unsigned int [unsigned] [usertype] <noident>
       got restricted ovs_be32

I got a lot of false positives initially but I'm getting it beaten
into shape in a local branch now.  This is the only serious bug that
I've found so far.

On Wed, May 04, 2011 at 04:15:55PM -0700, Ethan Jackson wrote:
> Nifty, looks good.  What was the error sparse gave on this?  Are you
> getting a lot of false positives, or is it looking pretty good?
> 
> Ethan
> 
> On Wed, May 4, 2011 at 15:47, Ben Pfaff <blp at nicira.com> wrote:
> > Found by sparse.
> > ---
> > ?lib/ofp-util.c | ? ?2 +-
> > ?1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/lib/ofp-util.c b/lib/ofp-util.c
> > index 5aa2b82..ddac772 100644
> > --- a/lib/ofp-util.c
> > +++ b/lib/ofp-util.c
> > @@ -1922,7 +1922,7 @@ check_action(const union ofp_action *a, unsigned int len,
> > ? ? ? ? if (error) {
> > ? ? ? ? ? ? return error;
> > ? ? ? ? }
> > - ? ? ? ?if (a->vlan_vid.vlan_vid & ~7) {
> > + ? ? ? ?if (a->vlan_pcp.vlan_pcp & ~7) {
> > ? ? ? ? ? ? return ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_ARGUMENT);
> > ? ? ? ? }
> > ? ? ? ? return 0;
> > --
> > 1.7.4.4
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev
> >



More information about the dev mailing list