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

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

 



On Tue, Jun 07, 2016 at 12:43:45AM +0200, Pablo Neira Ayuso wrote:
> On Mon, Jun 06, 2016 at 09:25:46PM +0200, Laura Garcia Liebana wrote:
> > Add translation for frag to nftables. According to the --fraglen code:
> > 
> > 	case O_FRAGLEN:
> > 		/*
> > 		 * As of Linux 3.0, the kernel does not check for
> > 		 * fraglen at all.
> > 		 */
> > 
> > In addition, the kernel code doesn't show any reference to the flag
> > IP6T_FRAG_LEN, so this option is deprecated and won't be translated to
> > nft.
> > 
> > Examples:
> > 
> > $ sudo iptables-translate -t filter -A INPUT -m frag --fragid 100:200 -j ACCEPT
> > nft add rule ip6 filter INPUT frag id 100-200 counter accept
> > 
> > $ sudo iptables-translate -t filter -A INPUT -m frag --fragid 100 --fragres --fragmore -j ACCEPT
> > nft add rule ip6 filter INPUT frag id 100 frag reserved 1 frag more-fragments 1 counter accept
> > 
> > $ sudo iptables-translate -t filter -A INPUT -m frag ! --fragid 100:200 -j ACCEPT
> > nft add rule ip6 filter INPUT frag id != 100-200 counter accept
> > 
> > $ sudo iptables-translate -t filter -A INPUT -m frag --fragid 100:200 --fraglast -j ACCEPT
> > nft add rule ip6 filter INPUT frag id 100-200 frag more-fragments 1 counter accept
> > 
> > $ sudo iptables-translate -t filter -A INPUT -m frag --fragid 100:200 --fragfirst -j ACCEPT
> > nft add rule ip6 filter INPUT frag id 100-200 frag frag-off 0 counter accept
> 
> Also applied, thanks.

Wait..

+static int frag_xlate(const void *ip, const struct xt_entry_match *match,
+                     struct xt_xlate *xl, int numeric)
+{
+       const struct ip6t_frag *fraginfo = (struct ip6t_frag
*)match->data;
+
+       if (fraginfo->flags & IP6T_FRAG_LEN)
+               return 0;

You better ignore completely IP6T_FRAG_LEN as the kernelside does.

No need to give up on providing a translation if this is used,
instead, let's relax this.

So please, remove this check. 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