net: use IS_ENABLED(CONFIG_IPV6)
Instead of testing defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
1ded132d4c
commit
dfd56b8b38
@@ -21,7 +21,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/export.h>
|
||||
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
|
||||
static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap,
|
||||
char *buf, const int buflen)
|
||||
@@ -91,7 +91,7 @@ static size_t rpc_ntop6(const struct sockaddr *sap,
|
||||
return len;
|
||||
}
|
||||
|
||||
#else /* !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) */
|
||||
#else /* !IS_ENABLED(CONFIG_IPV6) */
|
||||
|
||||
static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap,
|
||||
char *buf, const int buflen)
|
||||
@@ -105,7 +105,7 @@ static size_t rpc_ntop6(const struct sockaddr *sap,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) */
|
||||
#endif /* !IS_ENABLED(CONFIG_IPV6) */
|
||||
|
||||
static int rpc_ntop4(const struct sockaddr *sap,
|
||||
char *buf, const size_t buflen)
|
||||
@@ -155,7 +155,7 @@ static size_t rpc_pton4(const char *buf, const size_t buflen,
|
||||
return sizeof(struct sockaddr_in);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
static int rpc_parse_scope_id(const char *buf, const size_t buflen,
|
||||
const char *delim, struct sockaddr_in6 *sin6)
|
||||
{
|
||||
|
@@ -826,7 +826,7 @@ static int __svc_rpcb_register4(const u32 program, const u32 version,
|
||||
return error;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
/*
|
||||
* Register an "inet6" protocol family netid with the local
|
||||
* rpcbind daemon via an rpcbind v4 SET request.
|
||||
@@ -872,7 +872,7 @@ static int __svc_rpcb_register6(const u32 program, const u32 version,
|
||||
|
||||
return error;
|
||||
}
|
||||
#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
|
||||
#endif /* IS_ENABLED(CONFIG_IPV6) */
|
||||
|
||||
/*
|
||||
* Register a kernel RPC service via rpcbind version 4.
|
||||
@@ -893,11 +893,11 @@ static int __svc_register(const char *progname,
|
||||
error = __svc_rpcb_register4(program, version,
|
||||
protocol, port);
|
||||
break;
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
case PF_INET6:
|
||||
error = __svc_rpcb_register6(program, version,
|
||||
protocol, port);
|
||||
#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
|
||||
#endif
|
||||
}
|
||||
|
||||
if (error < 0)
|
||||
|
@@ -179,13 +179,13 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl,
|
||||
.sin_addr.s_addr = htonl(INADDR_ANY),
|
||||
.sin_port = htons(port),
|
||||
};
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
struct sockaddr_in6 sin6 = {
|
||||
.sin6_family = AF_INET6,
|
||||
.sin6_addr = IN6ADDR_ANY_INIT,
|
||||
.sin6_port = htons(port),
|
||||
};
|
||||
#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
|
||||
#endif
|
||||
struct sockaddr *sap;
|
||||
size_t len;
|
||||
|
||||
@@ -194,12 +194,12 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl,
|
||||
sap = (struct sockaddr *)&sin;
|
||||
len = sizeof(sin);
|
||||
break;
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
case PF_INET6:
|
||||
sap = (struct sockaddr *)&sin6;
|
||||
len = sizeof(sin6);
|
||||
break;
|
||||
#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
|
||||
#endif
|
||||
default:
|
||||
return ERR_PTR(-EAFNOSUPPORT);
|
||||
}
|
||||
|
@@ -220,7 +220,7 @@ static int ip_map_parse(struct cache_detail *cd,
|
||||
ipv6_addr_set_v4mapped(address.s4.sin_addr.s_addr,
|
||||
&sin6.sin6_addr);
|
||||
break;
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
case AF_INET6:
|
||||
memcpy(&sin6, &address.s6, sizeof(sin6));
|
||||
break;
|
||||
|
Reference in New Issue
Block a user