History

netfilter: bridge: Expose nf_tables bridge hook priorities through uapi

Netfilter exposes standard hook priorities in case of ipv4, ipv6 and arp but not in case of bridge. This patch exposes the hook priority values of the bridge family (which are different from the formerly mentioned) via uapi so that they can be used by user-space applications just like the others.

Máté Eckl committed 8 years ago

Commit 94276fa1 parent aaecfdb5 files · +14 −11Browse files

Unified · Split

5 files
  1. include/linux/netfilter_bridge.h +0 −11
  2. include/uapi/linux/netfilter_bridge.h +11 −0
  3. net/bridge/br_netfilter_hooks.c +1 −0
  4. net/bridge/netfilter/ebtable_filter.c +1 −0
  5. net/bridge/netfilter/ebtable_nat.c +1 −0
include/linux/netfilter_bridge.h+0−11
@@ -5,17 +5,6 @@ · 4 unmodified lines
55 #include <uapi/linux/netfilter_bridge.h>
66 #include <linux/skbuff.h>
77
8−enum nf_br_hook_priorities {
9− NF_BR_PRI_FIRST = INT_MIN,
10− NF_BR_PRI_NAT_DST_BRIDGED = -300,
11− NF_BR_PRI_FILTER_BRIDGED = -200,
12− NF_BR_PRI_BRNF = 0,
13− NF_BR_PRI_NAT_DST_OTHER = 100,
14− NF_BR_PRI_FILTER_OTHER = 200,
15− NF_BR_PRI_NAT_SRC = 300,
16− NF_BR_PRI_LAST = INT_MAX,
17−};
18−
198 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
209
2110 int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
include/uapi/linux/netfilter_bridge.h+11−0
@@ -26,4 +26,15 @@ · 25 unmodified lines
2626 #define NF_BR_BROUTING 5
2727 #define NF_BR_NUMHOOKS 6
2828
29+enum nf_br_hook_priorities {
30+ NF_BR_PRI_FIRST = INT_MIN,
31+ NF_BR_PRI_NAT_DST_BRIDGED = -300,
32+ NF_BR_PRI_FILTER_BRIDGED = -200,
33+ NF_BR_PRI_BRNF = 0,
34+ NF_BR_PRI_NAT_DST_OTHER = 100,
35+ NF_BR_PRI_FILTER_OTHER = 200,
36+ NF_BR_PRI_NAT_SRC = 300,
37+ NF_BR_PRI_LAST = INT_MAX,
38+};
39+
2940 #endif /* _UAPI__LINUX_BRIDGE_NETFILTER_H */
net/bridge/br_netfilter_hooks.c+1−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/if_pppox.h>
2727 #include <linux/ppp_defs.h>
2828 #include <linux/netfilter_bridge.h>
29+#include <uapi/linux/netfilter_bridge.h>
2930 #include <linux/netfilter_ipv4.h>
3031 #include <linux/netfilter_ipv6.h>
3132 #include <linux/netfilter_arp.h>
net/bridge/netfilter/ebtable_filter.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 */
1010
1111 #include <linux/netfilter_bridge/ebtables.h>
12+#include <uapi/linux/netfilter_bridge.h>
1213 #include <linux/module.h>
1314
1415 #define FILTER_VALID_HOOKS ((1 << NF_BR_LOCAL_IN) | (1 << NF_BR_FORWARD) | \
net/bridge/netfilter/ebtable_nat.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 */
1010
1111 #include <linux/netfilter_bridge/ebtables.h>
12+#include <uapi/linux/netfilter_bridge.h>
1213 #include <linux/module.h>
1314
1415 #define NAT_VALID_HOOKS ((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT) | \

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