ipv6: use IS_ENABLED()
#if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE) can be replaced by #if IS_ENABLED(CONFIG_FOO) Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
cc535dfb6a
commit
07a936260a
@@ -43,7 +43,7 @@
|
||||
#include <net/ndisc.h>
|
||||
#include <net/ip6_route.h>
|
||||
#include <net/addrconf.h>
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||
#include <net/xfrm.h>
|
||||
#endif
|
||||
|
||||
@@ -224,7 +224,7 @@ bad:
|
||||
Destination options header.
|
||||
*****************************/
|
||||
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||
static bool ipv6_dest_hao(struct sk_buff *skb, int optoff)
|
||||
{
|
||||
struct ipv6_destopt_hao *hao;
|
||||
@@ -288,7 +288,7 @@ static bool ipv6_dest_hao(struct sk_buff *skb, int optoff)
|
||||
#endif
|
||||
|
||||
static const struct tlvtype_proc tlvprocdestopt_lst[] = {
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||
{
|
||||
.type = IPV6_TLV_HAO,
|
||||
.func = ipv6_dest_hao,
|
||||
@@ -300,7 +300,7 @@ static const struct tlvtype_proc tlvprocdestopt_lst[] = {
|
||||
static int ipv6_destopt_rcv(struct sk_buff *skb)
|
||||
{
|
||||
struct inet6_skb_parm *opt = IP6CB(skb);
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||
__u16 dstbuf;
|
||||
#endif
|
||||
struct dst_entry *dst = skb_dst(skb);
|
||||
@@ -315,14 +315,14 @@ static int ipv6_destopt_rcv(struct sk_buff *skb)
|
||||
}
|
||||
|
||||
opt->lastopt = opt->dst1 = skb_network_header_len(skb);
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||
dstbuf = opt->dst1;
|
||||
#endif
|
||||
|
||||
if (ip6_parse_tlv(tlvprocdestopt_lst, skb)) {
|
||||
skb->transport_header += (skb_transport_header(skb)[1] + 1) << 3;
|
||||
opt = IP6CB(skb);
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||
opt->nhoff = dstbuf;
|
||||
#else
|
||||
opt->nhoff = opt->dst1;
|
||||
@@ -378,7 +378,7 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
|
||||
looped_back:
|
||||
if (hdr->segments_left == 0) {
|
||||
switch (hdr->type) {
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||
case IPV6_SRCRT_TYPE_2:
|
||||
/* Silently discard type 2 header unless it was
|
||||
* processed by own
|
||||
@@ -404,7 +404,7 @@ looped_back:
|
||||
}
|
||||
|
||||
switch (hdr->type) {
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||
case IPV6_SRCRT_TYPE_2:
|
||||
if (accept_source_route < 0)
|
||||
goto unknown_rh;
|
||||
@@ -461,7 +461,7 @@ looped_back:
|
||||
addr += i - 1;
|
||||
|
||||
switch (hdr->type) {
|
||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
||||
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||
case IPV6_SRCRT_TYPE_2:
|
||||
if (xfrm6_input_addr(skb, (xfrm_address_t *)addr,
|
||||
(xfrm_address_t *)&ipv6_hdr(skb)->saddr,
|
||||
|
||||
Reference in New Issue
Block a user