Skip to content

Commit 176971b

Browse files
ebiedermummakynes
authored andcommitted
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: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent a31f1ad commit 176971b

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎net/netfilter/ipvs/ip_vs_core.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ static unsigned int
13141314
ip_vs_reply4(const struct nf_hook_ops *ops, struct sk_buff *skb,
13151315
const struct nf_hook_state *state)
13161316
{
1317-
return ip_vs_out(ops->hooknum, skb, AF_INET);
1317+
return ip_vs_out(state->hook, skb, AF_INET);
13181318
}
13191319

13201320
/*
@@ -1325,7 +1325,7 @@ static unsigned int
13251325
ip_vs_local_reply4(const struct nf_hook_ops *ops, struct sk_buff *skb,
13261326
const struct nf_hook_state *state)
13271327
{
1328-
return ip_vs_out(ops->hooknum, skb, AF_INET);
1328+
return ip_vs_out(state->hook, skb, AF_INET);
13291329
}
13301330

13311331
#ifdef CONFIG_IP_VS_IPV6
@@ -1339,7 +1339,7 @@ static unsigned int
13391339
ip_vs_reply6(const struct nf_hook_ops *ops, struct sk_buff *skb,
13401340
const struct nf_hook_state *state)
13411341
{
1342-
return ip_vs_out(ops->hooknum, skb, AF_INET6);
1342+
return ip_vs_out(state->hook, skb, AF_INET6);
13431343
}
13441344

13451345
/*
@@ -1350,7 +1350,7 @@ static unsigned int
13501350
ip_vs_local_reply6(const struct nf_hook_ops *ops, struct sk_buff *skb,
13511351
const struct nf_hook_state *state)
13521352
{
1353-
return ip_vs_out(ops->hooknum, skb, AF_INET6);
1353+
return ip_vs_out(state->hook, skb, AF_INET6);
13541354
}
13551355

13561356
#endif
@@ -1850,7 +1850,7 @@ static unsigned int
18501850
ip_vs_remote_request4(const struct nf_hook_ops *ops, struct sk_buff *skb,
18511851
const struct nf_hook_state *state)
18521852
{
1853-
return ip_vs_in(ops->hooknum, skb, AF_INET);
1853+
return ip_vs_in(state->hook, skb, AF_INET);
18541854
}
18551855

18561856
/*
@@ -1861,7 +1861,7 @@ static unsigned int
18611861
ip_vs_local_request4(const struct nf_hook_ops *ops, struct sk_buff *skb,
18621862
const struct nf_hook_state *state)
18631863
{
1864-
return ip_vs_in(ops->hooknum, skb, AF_INET);
1864+
return ip_vs_in(state->hook, skb, AF_INET);
18651865
}
18661866

18671867
#ifdef CONFIG_IP_VS_IPV6
@@ -1874,7 +1874,7 @@ static unsigned int
18741874
ip_vs_remote_request6(const struct nf_hook_ops *ops, struct sk_buff *skb,
18751875
const struct nf_hook_state *state)
18761876
{
1877-
return ip_vs_in(ops->hooknum, skb, AF_INET6);
1877+
return ip_vs_in(state->hook, skb, AF_INET6);
18781878
}
18791879

18801880
/*
@@ -1885,7 +1885,7 @@ static unsigned int
18851885
ip_vs_local_request6(const struct nf_hook_ops *ops, struct sk_buff *skb,
18861886
const struct nf_hook_state *state)
18871887
{
1888-
return ip_vs_in(ops->hooknum, skb, AF_INET6);
1888+
return ip_vs_in(state->hook, skb, AF_INET6);
18891889
}
18901890

18911891
#endif

0 commit comments

Comments
 (0)