Re: [libnftables PATCH 11/13] expr: payload: add nft_str2base function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 09, 2013 at 01:31:35PM +0200, Arturo Borrero Gonzalez wrote:
> >         if (base_str == NULL)
> >                 return -1;
> >
> > -       if (strcmp(base_str, "link") == 0)
> > -               payload->base = NFT_PAYLOAD_LL_HEADER;
> > -       else if (strcmp(base_str, "network") == 0)
> > -               payload->base = NFT_PAYLOAD_NETWORK_HEADER;
> > -       else if (strcmp(base_str, "transport") == 0)
> > -               payload->base = NFT_PAYLOAD_TRANSPORT_HEADER;
> > -       else
> > -               goto err;
> > +       base = nft_str2base(base_str);
> > +
> > +       if (base < 0)
> > +               return -1;
> 
> I think we need this:
> 
> payload->base = base;

Good catch, I'm going to manually fix this. Thanks for reviewing.

> Also, maybe goto err in case of base < 0

errno is already set from the new function.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux