History

netfilter: deprecate NF_STOP

NF_STOP is only used by br_netfilter these days, and it can be emulated with a combination of NF_STOLEN plus explicit call to the ->okfn() function as Florian suggests. To retain binary compatibility with userspace nf_queue application, we have to keep NF_STOP around, so libnetfilter_queue userspace userspace applications still work if they use NF_STOP for some exotic reason. Out of tree modules using NF_STOP would break, but we don't care about those.

Pablo Neira Ayuso committed 10 years ago

Commit 06fd3a31 parent 1610a733 files · +6 −4Browse files

Unified · Split

3 files
  1. include/uapi/linux/netfilter.h +1 −1
  2. net/bridge/br_netfilter_hooks.c +4 −2
  3. net/netfilter/core.c +1 −1
include/uapi/linux/netfilter.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #define NF_STOLEN 2
1414 #define NF_QUEUE 3
1515 #define NF_REPEAT 4
16−#define NF_STOP 5
16+#define NF_STOP 5 /* Deprecated, for userspace nf_queue compatibility. */
1717 #define NF_MAX_VERDICT NF_STOP
1818
1919 /* we overload the higher bits for encoding auxiliary data such as the queue
net/bridge/br_netfilter_hooks.c+4−2
@@ -845,8 +845,10 @@ static unsigned int ip_sabotage_in(void *priv, · 844 unmodified lines
845845 struct sk_buff *skb,
846846 const struct nf_hook_state *state)
847847 {
848− if (skb->nf_bridge && !skb->nf_bridge->in_prerouting)
849− return NF_STOP;
848+ if (skb->nf_bridge && !skb->nf_bridge->in_prerouting) {
849+ state->okfn(state->net, state->sk, skb);
850+ return NF_STOLEN;
851+ }
850852
851853 return NF_ACCEPT;
852854 }
net/netfilter/core.c+1−1
@@ -333,7 +333,7 @@ int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state) · 332 unmodified lines
333333 entry = rcu_dereference(state->hook_entries);
334334 next_hook:
335335 verdict = nf_iterate(skb, state, &entry);
336− if (verdict == NF_ACCEPT || verdict == NF_STOP) {
336+ if (verdict == NF_ACCEPT) {
337337 ret = 1;
338338 } else if ((verdict & NF_VERDICT_MASK) == NF_DROP) {
339339 kfree_skb(skb);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t