summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_metrics.c
diff options
context:
space:
mode:
authorEric Dumazet2013-10-09 12:05:48 +0200
committerDavid S. Miller2013-10-09 19:04:03 +0200
commitc2bb06db59eaf92eb5ca9c6faed590597c6ceccb (patch)
tree7e9018dd587e8ec552d5d101981f42f101b16dcd /net/ipv4/tcp_metrics.c
parentudp: fix a typo in __udp4_lib_mcast_demux_lookup (diff)
downloadkernel-qcow2-linux-c2bb06db59eaf92eb5ca9c6faed590597c6ceccb.tar.gz
kernel-qcow2-linux-c2bb06db59eaf92eb5ca9c6faed590597c6ceccb.tar.xz
kernel-qcow2-linux-c2bb06db59eaf92eb5ca9c6faed590597c6ceccb.zip
net: fix build errors if ipv6 is disabled
CONFIG_IPV6=n is still a valid choice ;) It appears we can remove dead code. Reported-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_metrics.c')
-rw-r--r--net/ipv4/tcp_metrics.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index 27535fd5ea10..8fcc2cb9dba4 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -251,10 +251,12 @@ static struct tcp_metrics_block *__tcp_get_metrics_tw(struct inet_timewait_sock
addr.addr.a4 = tw->tw_daddr;
hash = (__force unsigned int) addr.addr.a4;
break;
+#if IS_ENABLED(CONFIG_IPV6)
case AF_INET6:
*(struct in6_addr *)addr.addr.a6 = tw->tw_v6_daddr;
hash = ipv6_addr_hash(&tw->tw_v6_daddr);
break;
+#endif
default:
return NULL;
}
@@ -286,10 +288,12 @@ static struct tcp_metrics_block *tcp_get_metrics(struct sock *sk,
addr.addr.a4 = inet_sk(sk)->inet_daddr;
hash = (__force unsigned int) addr.addr.a4;
break;
+#if IS_ENABLED(CONFIG_IPV6)
case AF_INET6:
*(struct in6_addr *)addr.addr.a6 = sk->sk_v6_daddr;
hash = ipv6_addr_hash(&sk->sk_v6_daddr);
break;
+#endif
default:
return NULL;
}