[PATCH nf 1/1] nft: Fix nlmsg_type in GET operation callbacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux