Re: [PATCHv2] extensions: libip6t_icmp6: Add translation to nft

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

 



On Mon, Mar 07, 2016 at 07:08:51PM +0100, Laura Garcia wrote:
> On Mon, Mar 07, 2016 at 06:11:19PM +0100, Pablo Neira Ayuso wrote:
> > 
> > #define XT_ICMPV6_TYPE(type)    (ND_ROUTER_SOLICIT - type)
> > 
> > static const char *icmp6_type_xlate_array[] = {
> >         [XT_ICMPV6_TYPE(ND_ROUTER_SOLICIT))]    = "nd-router-solicit",
> >         [XT_ICMPV6_TYPE(ND_ROUTER_ADVERT)]      = "nd-router-advert",
> >         ...
> >         [XT_ICMPV6_TYPE(ND_REDIRECT)]           = "nd-redirect",
> > };
> > 
> > static const char *icmp6_type_xlate(unsigned int type)
> > {
> >         unsigned type
> > 
> >         if (type < ND_ROUTER_SOLICIT || type > ND_REDIRECT))
> >                 return NULL;
> > 
> >         return icmp6_type_xlate_array[XT_ICMPV6_TYPE(type)];
> > }
> > 
> > Then, from type_xlate_print() use this icmp6_type_xlate().
> > 
> 
> Ok
> 
> > > +	default:
> > > +		for (i = 0; ARRAY_SIZE(icmpv6_codes); ++i)
> >                                                            ^
> > BTW, missing opening bracket here
> > 
> > > +			if (icmpv6_codes[i].type == icmptype &&
> > > +			    icmpv6_codes[i].code_min == code_min &&
> > > +			    icmpv6_codes[i].code_max == code_max)
> > > +				break;
> > > +			xt_xlate_add(xl, icmpv6_codes[i].name);
> > 
> > and closing bracket here '}'
> > 
> > BTW, do you really need this code now that we just skip when we get an
> > icmp code?
> > 
> 
> Same thing here, the brackets are not needed. It's only a indentation
> problem in the function xt_xlate_add.

Ok, thanks for explaining.

Please, send a v3 with the proposed changes above and resubmit.
Thanks.
--
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