Commit 1b75097dd7a2680d2e209fe452b6fab01a511fb1
Committed by
Simon Horman
1 parent
2300f0451e
ipvs: Pass ipvs into ip_vs_out
Derive ipvs from state->net in the callers of ip_vs_out 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 6 additions and 9 deletions Side-by-side Diff
net/netfilter/ipvs/ip_vs_core.c
... | ... | @@ -1173,10 +1173,9 @@ |
1173 | 1173 | * Check if outgoing packet belongs to the established ip_vs_conn. |
1174 | 1174 | */ |
1175 | 1175 | static unsigned int |
1176 | -ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af) | |
1176 | +ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, int af) | |
1177 | 1177 | { |
1178 | - struct net *net = NULL; | |
1179 | - struct netns_ipvs *ipvs; | |
1178 | + struct net *net = ipvs->net; | |
1180 | 1179 | struct ip_vs_iphdr iph; |
1181 | 1180 | struct ip_vs_protocol *pp; |
1182 | 1181 | struct ip_vs_proto_data *pd; |
... | ... | @@ -1201,8 +1200,6 @@ |
1201 | 1200 | if (unlikely(!skb_dst(skb))) |
1202 | 1201 | return NF_ACCEPT; |
1203 | 1202 | |
1204 | - net = skb_net(skb); | |
1205 | - ipvs = net_ipvs(net); | |
1206 | 1203 | if (!ipvs->enable) |
1207 | 1204 | return NF_ACCEPT; |
1208 | 1205 | |
... | ... | @@ -1306,7 +1303,7 @@ |
1306 | 1303 | ip_vs_reply4(void *priv, struct sk_buff *skb, |
1307 | 1304 | const struct nf_hook_state *state) |
1308 | 1305 | { |
1309 | - return ip_vs_out(state->hook, skb, AF_INET); | |
1306 | + return ip_vs_out(net_ipvs(state->net), state->hook, skb, AF_INET); | |
1310 | 1307 | } |
1311 | 1308 | |
1312 | 1309 | /* |
... | ... | @@ -1317,7 +1314,7 @@ |
1317 | 1314 | ip_vs_local_reply4(void *priv, struct sk_buff *skb, |
1318 | 1315 | const struct nf_hook_state *state) |
1319 | 1316 | { |
1320 | - return ip_vs_out(state->hook, skb, AF_INET); | |
1317 | + return ip_vs_out(net_ipvs(state->net), state->hook, skb, AF_INET); | |
1321 | 1318 | } |
1322 | 1319 | |
1323 | 1320 | #ifdef CONFIG_IP_VS_IPV6 |
... | ... | @@ -1331,7 +1328,7 @@ |
1331 | 1328 | ip_vs_reply6(void *priv, struct sk_buff *skb, |
1332 | 1329 | const struct nf_hook_state *state) |
1333 | 1330 | { |
1334 | - return ip_vs_out(state->hook, skb, AF_INET6); | |
1331 | + return ip_vs_out(net_ipvs(state->net), state->hook, skb, AF_INET6); | |
1335 | 1332 | } |
1336 | 1333 | |
1337 | 1334 | /* |
... | ... | @@ -1342,7 +1339,7 @@ |
1342 | 1339 | ip_vs_local_reply6(void *priv, struct sk_buff *skb, |
1343 | 1340 | const struct nf_hook_state *state) |
1344 | 1341 | { |
1345 | - return ip_vs_out(state->hook, skb, AF_INET6); | |
1342 | + return ip_vs_out(net_ipvs(state->net), state->hook, skb, AF_INET6); | |
1346 | 1343 | } |
1347 | 1344 | |
1348 | 1345 | #endif |