提交 176971b3 编写于 作者: E Eric W. Biederman 提交者: Pablo Neira Ayuso

ipvs: Read hooknum from state rather than ops->hooknum

This should be more cache efficient as state is more likely to be in
core, and the netfilter core will stop passing in ops soon.
Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 a31f1adc
...@@ -1314,7 +1314,7 @@ static unsigned int ...@@ -1314,7 +1314,7 @@ static unsigned int
ip_vs_reply4(const struct nf_hook_ops *ops, struct sk_buff *skb, ip_vs_reply4(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_out(ops->hooknum, skb, AF_INET); return ip_vs_out(state->hook, skb, AF_INET);
} }
/* /*
...@@ -1325,7 +1325,7 @@ static unsigned int ...@@ -1325,7 +1325,7 @@ static unsigned int
ip_vs_local_reply4(const struct nf_hook_ops *ops, struct sk_buff *skb, ip_vs_local_reply4(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_out(ops->hooknum, skb, AF_INET); return ip_vs_out(state->hook, skb, AF_INET);
} }
#ifdef CONFIG_IP_VS_IPV6 #ifdef CONFIG_IP_VS_IPV6
...@@ -1339,7 +1339,7 @@ static unsigned int ...@@ -1339,7 +1339,7 @@ static unsigned int
ip_vs_reply6(const struct nf_hook_ops *ops, struct sk_buff *skb, ip_vs_reply6(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_out(ops->hooknum, skb, AF_INET6); return ip_vs_out(state->hook, skb, AF_INET6);
} }
/* /*
...@@ -1350,7 +1350,7 @@ static unsigned int ...@@ -1350,7 +1350,7 @@ static unsigned int
ip_vs_local_reply6(const struct nf_hook_ops *ops, struct sk_buff *skb, ip_vs_local_reply6(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_out(ops->hooknum, skb, AF_INET6); return ip_vs_out(state->hook, skb, AF_INET6);
} }
#endif #endif
...@@ -1850,7 +1850,7 @@ static unsigned int ...@@ -1850,7 +1850,7 @@ static unsigned int
ip_vs_remote_request4(const struct nf_hook_ops *ops, struct sk_buff *skb, ip_vs_remote_request4(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_in(ops->hooknum, skb, AF_INET); return ip_vs_in(state->hook, skb, AF_INET);
} }
/* /*
...@@ -1861,7 +1861,7 @@ static unsigned int ...@@ -1861,7 +1861,7 @@ static unsigned int
ip_vs_local_request4(const struct nf_hook_ops *ops, struct sk_buff *skb, ip_vs_local_request4(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_in(ops->hooknum, skb, AF_INET); return ip_vs_in(state->hook, skb, AF_INET);
} }
#ifdef CONFIG_IP_VS_IPV6 #ifdef CONFIG_IP_VS_IPV6
...@@ -1874,7 +1874,7 @@ static unsigned int ...@@ -1874,7 +1874,7 @@ static unsigned int
ip_vs_remote_request6(const struct nf_hook_ops *ops, struct sk_buff *skb, ip_vs_remote_request6(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_in(ops->hooknum, skb, AF_INET6); return ip_vs_in(state->hook, skb, AF_INET6);
} }
/* /*
...@@ -1885,7 +1885,7 @@ static unsigned int ...@@ -1885,7 +1885,7 @@ static unsigned int
ip_vs_local_request6(const struct nf_hook_ops *ops, struct sk_buff *skb, ip_vs_local_request6(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_in(ops->hooknum, skb, AF_INET6); return ip_vs_in(state->hook, skb, AF_INET6);
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部