ip_vti: Fix unused variable warning
authorYueHaibing <yuehaibing@huawei.com>
Fri, 31 Jul 2020 06:49:52 +0000 (14:49 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Sat, 8 Aug 2020 06:17:22 +0000 (08:17 +0200)
If CONFIG_INET_XFRM_TUNNEL is set but CONFIG_IPV6 is n,

net/ipv4/ip_vti.c:493:27: warning: 'vti_ipip6_handler' defined but not used [-Wunused-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv4/ip_vti.c

index 49daaed..f687abb 100644 (file)
@@ -490,6 +490,7 @@ static struct xfrm_tunnel vti_ipip_handler __read_mostly = {
        .priority       =       0,
 };
 
+#if IS_ENABLED(CONFIG_IPV6)
 static struct xfrm_tunnel vti_ipip6_handler __read_mostly = {
        .handler        =       vti_rcv_tunnel,
        .cb_handler     =       vti_rcv_cb,
@@ -497,6 +498,7 @@ static struct xfrm_tunnel vti_ipip6_handler __read_mostly = {
        .priority       =       0,
 };
 #endif
+#endif
 
 static int __net_init vti_init_net(struct net *net)
 {