netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shivani Bhardwaj <shivanib134@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH 1/2] iptables: nft-ipv4: Add ip ttl to the buffer
Date: Mon, 4 Jan 2016 22:49:40 +0530	[thread overview]
Message-ID: <43eb8fe0401a5c813cfaa1002799dc00f667c4b9.1451927507.git.shivanib134@gmail.com> (raw)
In-Reply-To: <cover.1451927507.git.shivanib134@gmail.com>

Add the string "ip ttl" to the buffer whenever a match for ttl is found as
ttl needs to be specified with the version of protocol being used.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
 iptables/nft-ipv4.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/iptables/nft-ipv4.c b/iptables/nft-ipv4.c
index ede8f17..684096f 100644
--- a/iptables/nft-ipv4.c
+++ b/iptables/nft-ipv4.c
@@ -477,6 +477,9 @@ static int nft_ipv4_xlate(const void *data, struct xt_buf *buf)
 			   inet_ntoa(cs->fw.ip.dst));
 	}
 
+	if (xlate_find_match(cs, "ttl"))
+		xt_buf_add(buf, "ip ttl ");
+
 	ret = xlate_matches(cs, buf);
 	if (!ret)
 		return ret;
-- 
1.9.1


  reply	other threads:[~2016-01-04 17:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 17:19 [PATCH 0/2] Add support for ttl translation Shivani Bhardwaj
2016-01-04 17:19 ` Shivani Bhardwaj [this message]
2016-01-04 17:20 ` [PATCH 2/2] extensions: libipt_ttl: Add translation to nft Shivani Bhardwaj
2016-01-04 17:40 ` [PATCH 0/2] Add support for ttl translation Pablo Neira Ayuso
2016-01-04 17:42   ` Shivani Bhardwaj
2016-01-04 17:44     ` Pablo Neira Ayuso

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=43eb8fe0401a5c813cfaa1002799dc00f667c4b9.1451927507.git.shivanib134@gmail.com \
    --to=shivanib134@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).