tcp: Fix build error if IPV6 is not selected
authorTushar Behera <tushar.behera@linaro.org>
Wed, 26 Mar 2014 09:57:05 +0000 (15:27 +0530)
committerJohn Stultz <john.stultz@linaro.org>
Wed, 26 Mar 2014 17:44:48 +0000 (10:44 -0700)
If CONFIG_IPV6=m is selected, we are getting following build errors.

net/built-in.o: In function `tcp_is_local6':
net/ipv4/tcp.c:3261: undefined reference to `rt6_lookup'

Making the code conditional upon only CONFIG_IPV6=y fixes this issue.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
CC: John Stultz <john.stultz@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
net/ipv4/tcp.c

index 880d2a644ca296624104e392c4fd87aaf8f13339..7921d1abc449f0924eac2f8c58972fa31a44dd42 100644 (file)
@@ -3471,7 +3471,7 @@ static int tcp_is_local(struct net *net, __be32 addr) {
        return rt->dst.dev && (rt->dst.dev->flags & IFF_LOOPBACK);
 }
 
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+#if defined(CONFIG_IPV6)
 static int tcp_is_local6(struct net *net, struct in6_addr *addr) {
        struct rt6_info *rt6 = rt6_lookup(net, addr, addr, 0, 0);
        return rt6 && rt6->dst.dev && (rt6->dst.dev->flags & IFF_LOOPBACK);
@@ -3528,7 +3528,7 @@ restart:
                                        continue;
                        }
 
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+#if defined(CONFIG_IPV6)
                        if (family == AF_INET6) {
                                struct in6_addr *s6;
                                if (!inet->pinet6)