Patchwork [09/11] netfilter: nf_tables: return error for rule change request

login
register
mail settings
Submitter Patrick McHardy
Date Dec. 12, 2012, 6:47 p.m.
Message ID <1355338061-5517-10-git-send-email-kaber@trash.net>
Download mbox | patch
Permalink /patch/205620/
State Accepted
Headers show

Comments

Patrick McHardy - Dec. 12, 2012, 6:47 p.m.
From: Patrick McHardy <kaber@trash.net>

We only support full replacement, not change of a rule.

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

Patch

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index bacd417..c91f638 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1372,7 +1372,7 @@  static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb,
 			old_rule = rule;
 			rule = NULL;
 		} else
-			return 0;
+			return -EOPNOTSUPP;
 	} else {
 		if (!create)
 			return -EINVAL;