Skip to content

Commit c93a49b

Browse files
whispererindarknessummakynes
authored andcommitted
ipvs: fix warning on unused variable
When CONFIG_IP_VS_IPV6 is not defined, build produced this warning: net/netfilter/ipvs/ip_vs_ctl.c:899:6: warning: unused variable ‘ret’ [-Wunused-variable] int ret = 0; ^~~ Fix this by moving the declaration of 'ret' in the CONFIG_IP_VS_IPV6 section in the same function. While at it, drop its unneeded initialisation. Fixes: 098e13f ("ipvs: fix dependency on nf_defrag_ipv6") Reported-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Reviewed-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 23b7ca4 commit c93a49b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/ipvs/ip_vs_ctl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,12 +896,13 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest,
896896
{
897897
struct ip_vs_dest *dest;
898898
unsigned int atype, i;
899-
int ret = 0;
900899

901900
EnterFunction(2);
902901

903902
#ifdef CONFIG_IP_VS_IPV6
904903
if (udest->af == AF_INET6) {
904+
int ret;
905+
905906
atype = ipv6_addr_type(&udest->addr.in6);
906907
if ((!(atype & IPV6_ADDR_UNICAST) ||
907908
atype & IPV6_ADDR_LINKLOCAL) &&

0 commit comments

Comments
 (0)