提交 ed1c9f0e 编写于 作者: D David Ahern 提交者: Simon Horman

ipvs: Remove possibly unused variable from ip_vs_out

Eric's net namespace changes in 1b75097d leaves net unreferenced if
CONFIG_IP_VS_IPV6 is not enabled:

../net/netfilter/ipvs/ip_vs_core.c: In function ‘ip_vs_out’:
../net/netfilter/ipvs/ip_vs_core.c:1177:14: warning: unused variable ‘net’ [-Wunused-variable]

After the net refactoring there is only 1 user; push the reference to the
1 user. While the line length slightly exceeds 80 it seems to be the
best change.

Fixes: 1b75097d("ipvs: Pass ipvs into ip_vs_out")
Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
Acked-by: NJulian Anastasov <ja@ssi.bg>
[horms: updated subject]
Signed-off-by: NSimon Horman <horms@verge.net.au>
上级 a29a9a58
...@@ -1172,7 +1172,6 @@ handle_response(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd, ...@@ -1172,7 +1172,6 @@ handle_response(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
static unsigned int static unsigned int
ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, int af) ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, int af)
{ {
struct net *net = ipvs->net;
struct ip_vs_iphdr iph; struct ip_vs_iphdr iph;
struct ip_vs_protocol *pp; struct ip_vs_protocol *pp;
struct ip_vs_proto_data *pd; struct ip_vs_proto_data *pd;
...@@ -1272,7 +1271,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, in ...@@ -1272,7 +1271,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, in
#ifdef CONFIG_IP_VS_IPV6 #ifdef CONFIG_IP_VS_IPV6
if (af == AF_INET6) { if (af == AF_INET6) {
if (!skb->dev) if (!skb->dev)
skb->dev = net->loopback_dev; skb->dev = ipvs->net->loopback_dev;
icmpv6_send(skb, icmpv6_send(skb,
ICMPV6_DEST_UNREACH, ICMPV6_DEST_UNREACH,
ICMPV6_PORT_UNREACH, ICMPV6_PORT_UNREACH,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册