netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harsha Sharma <harshasharmaiitr@gmail.com>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
	outreachy-kernel@googlegroups.com,
	Harsha Sharma <harshasharmaiitr@gmail.com>
Subject: [PATCH] exthdr: Add support for reserved header and address
Date: Mon,  2 Oct 2017 02:07:00 +0530	[thread overview]
Message-ID: <1506890220-12226-1-git-send-email-harshasharmaiitr@gmail.com> (raw)

Add support for IPV6 type 0 routing header reserved field and address
unable to test it with nft-test.py

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
---
 include/exthdr.h  | 2 ++
 src/exthdr.c      | 7 +------
 tests/py/ip6/rt.t | 2 ++
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/exthdr.h b/include/exthdr.h
index 97ccc38..ad09f27 100644
--- a/include/exthdr.h
+++ b/include/exthdr.h
@@ -14,6 +14,8 @@
 struct exthdr_desc {
 	const char			*name;
 	uint8_t				type;
+	unsigned int			protocol_key;
+	const struct exthdr_desc	*protocols[3];
 	struct proto_hdr_template	templates[10];
 };
 
diff --git a/src/exthdr.c b/src/exthdr.c
index 4add3da..87c09da 100644
--- a/src/exthdr.c
+++ b/src/exthdr.c
@@ -263,13 +263,8 @@ const struct exthdr_desc exthdr_rt0 = {
 const struct exthdr_desc exthdr_rt = {
 	.name		= "rt",
 	.type		= IPPROTO_ROUTING,
-#if 0
 	.protocol_key	= RTHDR_TYPE,
-	.protocols	= {
-		[0]	= &exthdr_rt0,
-		[2]	= &exthdr_rt2,
-	},
-#endif
+	.protocols	= {&exthdr_rt0, NULL, &exthdr_rt2},
 	.templates	= {
 		[RTHDR_NEXTHDR]		= RT_FIELD("nexthdr", ip6r_nxt, &inet_protocol_type),
 		[RTHDR_HDRLENGTH]	= RT_FIELD("hdrlength", ip6r_len, &integer_type),
diff --git a/tests/py/ip6/rt.t b/tests/py/ip6/rt.t
index 2d044c3..1eb198d 100644
--- a/tests/py/ip6/rt.t
+++ b/tests/py/ip6/rt.t
@@ -44,3 +44,5 @@ rt seg-left { 33, 55, 67, 88};ok
 rt seg-left != { 33, 55, 67, 88};ok
 rt seg-left { 33-55};ok
 rt seg-left != { 33-55};ok
+
+rt type 0 reserved 2;ok
-- 
1.9.1

             reply	other threads:[~2017-10-01 20:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-01 20:37 Harsha Sharma [this message]
2017-10-02 19:08 ` [PATCH] exthdr: Add support for reserved header and address 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=1506890220-12226-1-git-send-email-harshasharmaiitr@gmail.com \
    --to=harshasharmaiitr@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=pablo@netfilter.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).