netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vijay Subramanian <subramanian.vijay@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org, Vijay Subramanian <subramanian.vijay@gmail.com>
Subject: [PATCH nf 1/1] nft: Fix nlmsg_type in GET operation callbacks
Date: Sat, 29 Aug 2015 15:34:55 -0700	[thread overview]
Message-ID: <1440887695-15068-1-git-send-email-subramanian.vijay@gmail.com> (raw)

nf_tables_gettable(), nf_tables_getchain() and nf_tables_getrule()
send replies with nlmsg_type that correspond to ADD operation
instead of GET. Set the type correctly.

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
---
 net/netfilter/nf_tables_api.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index cfe6368..b97182a 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -571,7 +571,7 @@ static int nf_tables_gettable(struct sock *nlsk, struct sk_buff *skb,
 		return -ENOMEM;
 
 	err = nf_tables_fill_table_info(skb2, net, NETLINK_CB(skb).portid,
-					nlh->nlmsg_seq, NFT_MSG_NEWTABLE, 0,
+					nlh->nlmsg_seq, NFT_MSG_GETTABLE, 0,
 					family, table);
 	if (err < 0)
 		goto err;
@@ -1136,7 +1136,7 @@ static int nf_tables_getchain(struct sock *nlsk, struct sk_buff *skb,
 		return -ENOMEM;
 
 	err = nf_tables_fill_chain_info(skb2, net, NETLINK_CB(skb).portid,
-					nlh->nlmsg_seq, NFT_MSG_NEWCHAIN, 0,
+					nlh->nlmsg_seq, NFT_MSG_GETCHAIN, 0,
 					family, table, chain);
 	if (err < 0)
 		goto err;
@@ -1974,7 +1974,7 @@ static int nf_tables_getrule(struct sock *nlsk, struct sk_buff *skb,
 		return -ENOMEM;
 
 	err = nf_tables_fill_rule_info(skb2, net, NETLINK_CB(skb).portid,
-				       nlh->nlmsg_seq, NFT_MSG_NEWRULE, 0,
+				       nlh->nlmsg_seq, NFT_MSG_GETRULE, 0,
 				       family, table, chain, rule);
 	if (err < 0)
 		goto err;
-- 
1.7.9.5


             reply	other threads:[~2015-08-29 22:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29 22:34 Vijay Subramanian [this message]
2015-09-01 16:46 ` [PATCH nf 1/1] nft: Fix nlmsg_type in GET operation callbacks Pablo Neira Ayuso
2015-09-01 18:35   ` Vijay Subramanian

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=1440887695-15068-1-git-send-email-subramanian.vijay@gmail.com \
    --to=subramanian.vijay@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --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).