Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754164AbdIGGI7 (ORCPT ); Thu, 7 Sep 2017 02:08:59 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:20166 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753437AbdIGGI4 (ORCPT ); Thu, 7 Sep 2017 02:08:56 -0400 X-RM-TRANSID: 2eec59b0e2764d7-9c5f8 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee259b0e275632-19024 From: Haishuang Yan To: "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan Subject: [PATCH 2/2] ip6_tunnel: fix setting hop_limit value for ipv6 tunnel Date: Thu, 7 Sep 2017 14:08:35 +0800 Message-Id: <1504764515-13536-2-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1504764515-13536-1-git-send-email-yanhaishuang@cmss.chinamobile.com> References: <1504764515-13536-1-git-send-email-yanhaishuang@cmss.chinamobile.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 721 Lines: 24 Similar to vxlan/geneve tunnel, if hop_limit is zero, it should fall back to ip6_dst_hoplimt(). Signed-off-by: Haishuang Yan --- net/ipv6/ip6_tunnel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 3a0ba2a..10a693a 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1184,6 +1184,7 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield, init_tel_txopt(&opt, encap_limit); ipv6_push_frag_opts(skb, &opt.ops, &proto); } + hop_limit = hop_limit ? : ip6_dst_hoplimit(dst); /* Calculate max headroom for all the headers and adjust * needed_headroom if necessary. -- 1.8.3.1