diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2009-06-13 00:57:10 -0400 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-02-10 11:03:53 -0500 |
commit | 2b21e051472fdb4680076278b2ccf63ebc1cc3bc (patch) | |
tree | 284c85824fcc2de0016451be071f4dd2b377e9cb /net/ipv6 | |
parent | 737535c5cf3524e4bfaa91e22edefd52eccabbce (diff) |
netfilter: xtables: compact table hook functions (2/2)
The calls to ip6t_do_table only show minimal differences, so it seems
like a good cleanup to merge them to a single one too.
Space saving obtained by both patches: 6807725->6807373
("Total" column from `size -A`.)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/ip6table_filter.c | 8 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6table_raw.c | 8 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6table_security.c | 8 |
3 files changed, 6 insertions, 18 deletions
diff --git a/net/ipv6/netfilter/ip6table_filter.c b/net/ipv6/netfilter/ip6table_filter.c index 38074e933f67..866f34ae236b 100644 --- a/net/ipv6/netfilter/ip6table_filter.c +++ b/net/ipv6/netfilter/ip6table_filter.c | |||
@@ -64,13 +64,9 @@ ip6table_filter_hook(unsigned int hook, struct sk_buff *skb, | |||
64 | const struct net_device *in, const struct net_device *out, | 64 | const struct net_device *in, const struct net_device *out, |
65 | int (*okfn)(struct sk_buff *)) | 65 | int (*okfn)(struct sk_buff *)) |
66 | { | 66 | { |
67 | if (hook == NF_INET_LOCAL_OUT) | 67 | const struct net *net = dev_net((in != NULL) ? in : out); |
68 | return ip6t_do_table(skb, hook, in, out, | ||
69 | dev_net(out)->ipv6.ip6table_filter); | ||
70 | 68 | ||
71 | /* INPUT/FORWARD: */ | 69 | return ip6t_do_table(skb, hook, in, out, net->ipv6.ip6table_filter); |
72 | return ip6t_do_table(skb, hook, in, out, | ||
73 | dev_net(in)->ipv6.ip6table_filter); | ||
74 | } | 70 | } |
75 | 71 | ||
76 | static struct nf_hook_ops ip6t_ops[] __read_mostly = { | 72 | static struct nf_hook_ops ip6t_ops[] __read_mostly = { |
diff --git a/net/ipv6/netfilter/ip6table_raw.c b/net/ipv6/netfilter/ip6table_raw.c index 985e27cf1e0c..5451a36fbc21 100644 --- a/net/ipv6/netfilter/ip6table_raw.c +++ b/net/ipv6/netfilter/ip6table_raw.c | |||
@@ -48,13 +48,9 @@ ip6table_raw_hook(unsigned int hook, struct sk_buff *skb, | |||
48 | const struct net_device *in, const struct net_device *out, | 48 | const struct net_device *in, const struct net_device *out, |
49 | int (*okfn)(struct sk_buff *)) | 49 | int (*okfn)(struct sk_buff *)) |
50 | { | 50 | { |
51 | if (hook == NF_INET_PRE_ROUTING) | 51 | const struct net *net = dev_net((in != NULL) ? in : out); |
52 | return ip6t_do_table(skb, hook, in, out, | ||
53 | dev_net(in)->ipv6.ip6table_raw); | ||
54 | 52 | ||
55 | /* OUTPUT: */ | 53 | return ip6t_do_table(skb, hook, in, out, net->ipv6.ip6table_raw); |
56 | return ip6t_do_table(skb, hook, in, out, | ||
57 | dev_net(out)->ipv6.ip6table_raw); | ||
58 | } | 54 | } |
59 | 55 | ||
60 | static struct nf_hook_ops ip6t_ops[] __read_mostly = { | 56 | static struct nf_hook_ops ip6t_ops[] __read_mostly = { |
diff --git a/net/ipv6/netfilter/ip6table_security.c b/net/ipv6/netfilter/ip6table_security.c index 835858929358..841ea77f5218 100644 --- a/net/ipv6/netfilter/ip6table_security.c +++ b/net/ipv6/netfilter/ip6table_security.c | |||
@@ -69,13 +69,9 @@ ip6table_security_hook(unsigned int hook, struct sk_buff *skb, | |||
69 | const struct net_device *out, | 69 | const struct net_device *out, |
70 | int (*okfn)(struct sk_buff *)) | 70 | int (*okfn)(struct sk_buff *)) |
71 | { | 71 | { |
72 | if (hook == NF_INET_LOCAL_OUT) | 72 | const struct net *net = dev_net((in != NULL) ? in : out); |
73 | return ip6t_do_table(skb, hook, in, out, | ||
74 | dev_net(out)->ipv6.ip6table_security); | ||
75 | 73 | ||
76 | /* INPUT/FORWARD: */ | 74 | return ip6t_do_table(skb, hook, in, out, net->ipv6.ip6table_security); |
77 | return ip6t_do_table(skb, hook, in, out, | ||
78 | dev_net(in)->ipv6.ip6table_security); | ||
79 | } | 75 | } |
80 | 76 | ||
81 | static struct nf_hook_ops ip6t_ops[] __read_mostly = { | 77 | static struct nf_hook_ops ip6t_ops[] __read_mostly = { |