netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: FaTe <gokuvsvegita@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] libip6t_hbh: Add translation to nft
Date: Thu, 10 Mar 2016 19:47:15 +0100	[thread overview]
Message-ID: <20160310184715.GA16857@salvia> (raw)
In-Reply-To: <56DFCCED.8040909@gmail.com>

On Wed, Mar 09, 2016 at 12:42:45PM +0530, FaTe wrote:
> Added translation for hbh module .
> 
> Note: Currently, --hbh-opts support dont exist in nftables .
> 
> Example :
> $ ip6tables-translate -A INPUT -m hbh --hbh-len 40
> nft add rule ip6 filter INPUT hbh hdrlength  40 counter
> 
> $ sudo ip6tables-translate -A INPUT -m hbh ! --hbh-len 40
> nft add rule ip6 filter INPUT hbh hdrlength  != 40 counter
> 
> Signed-off-by: Piyush Pangtey <gokuvsvegita@gmail.com>
> ---
>  extensions/libip6t_hbh.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/extensions/libip6t_hbh.c b/extensions/libip6t_hbh.c
> index c0389ed..98dcade 100644
> --- a/extensions/libip6t_hbh.c
> +++ b/extensions/libip6t_hbh.c
> @@ -164,6 +164,27 @@ static void hbh_save(const void *ip, const struct xt_entry_match *match)
>  	print_options(optinfo->optsnr, (uint16_t *)optinfo->opts);
>  }
>  
> +static int hbh_xlate(const struct xt_entry_match *match, struct xt_xlate *xl,
> +		     int numeric)
> +{
> +	const struct ip6t_opts *optinfo = (struct ip6t_opts *)match->data;
> +
> +	if (optinfo->flags & IP6T_OPTS_LEN) {
> +		xt_xlate_add(xl," hbh hdrlength %s %u",
> +			    (optinfo->invflags & IP6T_OPTS_INV_LEN) ? " !=" :
> +			    "", optinfo->hdrlen);

I suggested Shivani you check how to translate:

ip6tables -I INPUT -m hbh

which seems to be value too.

http://www.spinics.net/lists/netfilter-devel/msg41045.html

So we make sure we provide a right translation for that too.

      reply	other threads:[~2016-03-10 18:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 21:21 [PATCHv3] extensions: libipt_icmp: Add translation to nft Laura Garcia Liebana
2016-03-08 10:53 ` Pablo Neira Ayuso
2016-03-09  6:58   ` [PATCH] libxt_multiport: " FaTe
2016-03-09 12:32     ` Pablo Neira Ayuso
2016-03-09 14:37       ` Piyush Pangtey
2016-03-09 14:39       ` [PATCH v2] " Piyush Pangtey
2016-03-09 17:30         ` Pablo Neira Ayuso
2016-03-10 12:50           ` [PATCH v3] " Piyush Pangtey
2016-03-10 18:31             ` Pablo Neira Ayuso
2016-03-09  7:05   ` Regarding libxt_multiport translation in nft FaTe
2016-03-09 10:06     ` Arturo Borrero Gonzalez
2016-03-09 14:34       ` Piyush Pangtey
2016-03-09  7:12   ` [PATCH] libip6t_hbh: Add translation to nft FaTe
2016-03-10 18:47     ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160310184715.GA16857@salvia \
    --to=pablo@netfilter.org \
    --cc=gokuvsvegita@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).