[ovs-dev] [PATCH] Add Nicira vendor extension actions NXAST_STACK_PUSH/POP

Ben Pfaff blp at nicira.com
Thu Feb 28 04:44:05 UTC 2013


On Wed, Feb 27, 2013 at 05:12:16PM -0800, Ethan Jackson wrote:
> +static union mf_value*
> > +nx_stack_pop(struct ofpbuf* stack)
> > +{
> > +    union mf_value* v =  NULL;
> > +    if (stack->size) {
> > +        stack -> size -= sizeof *v;
> > +        v = (union mf_value*)((char*)stack->data + stack->size);
> > +    }
> > +
> > +    return v;
> > +}
> > +
> >
> 
> Any reason we can't just use ofpbuf_try_pull() instead?

I think that would make it a queue instead of a stack.



More information about the dev mailing list