Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1405801

[PATCH v2] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6)

From Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Newsgroups linux.kernel
Subject [PATCH v2] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6)
Date 2016-05-24 04:50 +0200
Message-ID <rCazT-5FK-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


For ipv6 case, enclose the code block in macro IS_ENABLED(CONFIG_IPV6).

---
Changes in v2:
  - Place the "#if IS_ENABLED" block before the "} else if
(..) {" piece and the "#endif" before the closing brace and this
becomes much easier to look at.

Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
 net/ipv4/ip_tunnel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index a69ed94..4256349 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -665,9 +665,11 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
 		if (skb->protocol == htons(ETH_P_IP)) {
 			tos = inner_iph->tos;
 			connected = false;
+#if IS_ENABLED(CONFIG_IPV6)
 		} else if (skb->protocol == htons(ETH_P_IPV6)) {
 			tos = ipv6_get_dsfield((const struct ipv6hdr *)inner_iph);
 			connected = false;
+#endif
 		}
 	}
 
-- 
1.8.3.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6) Haishuang Yan <yanhaishuang@cmss.chinamobile.com> - 2016-05-24 04:50 +0200
  Re: [PATCH v2] ip_tunnel: enclose a code block in macro  IS_ENABLED(CONFIG_IPV6) Eric Dumazet <eric.dumazet@gmail.com> - 2016-05-24 05:20 +0200
    Re: [PATCH v2] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6) 严海双 <yanhaishuang@cmss.chinamobile.com> - 2016-05-24 06:00 +0200
      Re: [PATCH v2] ip_tunnel: enclose a code block in macro  IS_ENABLED(CONFIG_IPV6) David Miller <davem@davemloft.net> - 2016-05-24 06:10 +0200

csiph-web