From: Eric Leblond <eric@regit.org>
To: netfilter-devel@vger.kernel.org
Cc: Eric Leblond <eric@regit.org>
Subject: [libnftables PATCH 1/3] examples: delete payload code in nft-chain-add
Date: Tue, 4 Jun 2013 10:05:21 +0200 [thread overview]
Message-ID: <1370333124-11674-2-git-send-email-eric@regit.org> (raw)
In-Reply-To: <1370333124-11674-1-git-send-email-eric@regit.org>
'make check' was not working due to the fact that
'libnftables/payload.h' was not present. As the payload
related code was commented, the "I've got an axe" solution
was to remove all payload related code. This is done in this
patch.
Signed-off-by: Eric Leblond <eric@regit.org>
---
examples/nft-rule-add.c | 25 -------------------------
1 file changed, 25 deletions(-)
diff --git a/examples/nft-rule-add.c b/examples/nft-rule-add.c
index b906715..c2b8968 100644
--- a/examples/nft-rule-add.c
+++ b/examples/nft-rule-add.c
@@ -21,7 +21,6 @@
#include <libmnl/libmnl.h>
#include <libnftables/rule.h>
#include <libnftables/expr.h>
-#include <libnftables/payload.h>
#include <linux/netfilter_ipv4/ipt_LOG.h>
#include <linux/netfilter/xt_iprange.h>
@@ -93,29 +92,6 @@ static void add_expr_match(struct nft_rule *r)
#define field_sizeof(t, f) (sizeof(((t *)NULL)->f))
-static void add_payload2(struct nft_rule_expr *e)
-{
- nft_rule_expr_set_u32(e, NFT_EXPR_PAYLOAD_BASE,
- NFT_PAYLOAD_NETWORK_HEADER);
- nft_rule_expr_set_u32(e, NFT_EXPR_PAYLOAD_DREG, NFT_REG_1);
- nft_rule_expr_set_u32(e, NFT_EXPR_PAYLOAD_OFFSET,
- offsetof(struct iphdr, protocol));
- nft_rule_expr_set_u32(e, NFT_EXPR_PAYLOAD_LEN, 1);
-}
-
-static void add_payload(struct nft_rule *r)
-{
- struct nft_rule_expr *expr;
-
- expr = nft_rule_expr_alloc("payload");
- if (expr == NULL)
- return;
-
- add_payload2(expr);
-
- nft_rule_add_expr(r, expr);
-}
-
int main(int argc, char *argv[])
{
struct mnl_socket *nl;
@@ -153,7 +129,6 @@ int main(int argc, char *argv[])
add_expr_match(r);
add_expr_target(r);
-// add_payload(r);
char tmp[1024];
nft_rule_snprintf(tmp, sizeof(tmp), r, 0, 0);
--
1.7.10.4
next prev parent reply other threads:[~2013-06-04 8:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 8:05 [libnftables PATCH 0/3] small fixes Eric Leblond
2013-06-04 8:05 ` Eric Leblond [this message]
2013-06-05 3:52 ` [libnftables PATCH 1/3] examples: delete payload code in nft-chain-add Pablo Neira Ayuso
2013-06-04 8:05 ` [libnftables PATCH 2/3] nft-events: add newline to output Eric Leblond
2013-06-05 3:52 ` Pablo Neira Ayuso
2013-06-04 8:05 ` [libnftables PATCH 3/3] expr: fix display of dreg expression Eric Leblond
2013-06-05 3:53 ` Pablo Neira Ayuso
2013-06-04 8:16 ` [libnftables PATCH 0/3] small fixes Arturo Borrero Gonzalez
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=1370333124-11674-2-git-send-email-eric@regit.org \
--to=eric@regit.org \
--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).