Commit 6e385bb3efdbfaf09b564b93b2a834006802de84
Committed by
Simon Horman
1 parent
1b75097dd7
ipvs: Pass ipvs into ip_vs_in
Derive ipvs from state->net in the callers of ip_vs_in and pass it into ip_vs_out. Removing the need to use the hack skb_net. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
Showing 1 changed file with 5 additions and 9 deletions Side-by-side Diff
net/netfilter/ipvs/ip_vs_core.c
... | ... | @@ -1684,15 +1684,13 @@ |
1684 | 1684 | * and send it on its way... |
1685 | 1685 | */ |
1686 | 1686 | static unsigned int |
1687 | -ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) | |
1687 | +ip_vs_in(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, int af) | |
1688 | 1688 | { |
1689 | - struct net *net; | |
1690 | 1689 | struct ip_vs_iphdr iph; |
1691 | 1690 | struct ip_vs_protocol *pp; |
1692 | 1691 | struct ip_vs_proto_data *pd; |
1693 | 1692 | struct ip_vs_conn *cp; |
1694 | 1693 | int ret, pkts; |
1695 | - struct netns_ipvs *ipvs; | |
1696 | 1694 | int conn_reuse_mode; |
1697 | 1695 | |
1698 | 1696 | /* Already marked as IPVS request or reply? */ |
... | ... | @@ -1715,8 +1713,6 @@ |
1715 | 1713 | return NF_ACCEPT; |
1716 | 1714 | } |
1717 | 1715 | /* ipvs enabled in this netns ? */ |
1718 | - net = skb_net(skb); | |
1719 | - ipvs = net_ipvs(net); | |
1720 | 1716 | if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable)) |
1721 | 1717 | return NF_ACCEPT; |
1722 | 1718 | |
... | ... | @@ -1844,7 +1840,7 @@ |
1844 | 1840 | ip_vs_remote_request4(void *priv, struct sk_buff *skb, |
1845 | 1841 | const struct nf_hook_state *state) |
1846 | 1842 | { |
1847 | - return ip_vs_in(state->hook, skb, AF_INET); | |
1843 | + return ip_vs_in(net_ipvs(state->net), state->hook, skb, AF_INET); | |
1848 | 1844 | } |
1849 | 1845 | |
1850 | 1846 | /* |
... | ... | @@ -1855,7 +1851,7 @@ |
1855 | 1851 | ip_vs_local_request4(void *priv, struct sk_buff *skb, |
1856 | 1852 | const struct nf_hook_state *state) |
1857 | 1853 | { |
1858 | - return ip_vs_in(state->hook, skb, AF_INET); | |
1854 | + return ip_vs_in(net_ipvs(state->net), state->hook, skb, AF_INET); | |
1859 | 1855 | } |
1860 | 1856 | |
1861 | 1857 | #ifdef CONFIG_IP_VS_IPV6 |
... | ... | @@ -1868,7 +1864,7 @@ |
1868 | 1864 | ip_vs_remote_request6(void *priv, struct sk_buff *skb, |
1869 | 1865 | const struct nf_hook_state *state) |
1870 | 1866 | { |
1871 | - return ip_vs_in(state->hook, skb, AF_INET6); | |
1867 | + return ip_vs_in(net_ipvs(state->net), state->hook, skb, AF_INET6); | |
1872 | 1868 | } |
1873 | 1869 | |
1874 | 1870 | /* |
... | ... | @@ -1879,7 +1875,7 @@ |
1879 | 1875 | ip_vs_local_request6(void *priv, struct sk_buff *skb, |
1880 | 1876 | const struct nf_hook_state *state) |
1881 | 1877 | { |
1882 | - return ip_vs_in(state->hook, skb, AF_INET6); | |
1878 | + return ip_vs_in(net_ipvs(state->net), state->hook, skb, AF_INET6); | |
1883 | 1879 | } |
1884 | 1880 | |
1885 | 1881 | #endif |