From patchwork Mon Feb 17 13:22:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dichtel X-Patchwork-Id: 320962 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6CCB02C00CE for ; Tue, 18 Feb 2014 00:24:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753251AbaBQNYV (ORCPT ); Mon, 17 Feb 2014 08:24:21 -0500 Received: from 33.106-14-84.ripe.coltfrance.com ([84.14.106.33]:33411 "EHLO proxy.6wind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752702AbaBQNYU (ORCPT ); Mon, 17 Feb 2014 08:24:20 -0500 Received: from elsass.dev.6wind.com (unknown [10.16.0.149]) by proxy.6wind.com (Postfix) with ESMTPS id F11DB281C8; Mon, 17 Feb 2014 14:24:17 +0100 (CET) Received: from root by elsass.dev.6wind.com with local (Exim 4.80) (envelope-from ) id 1WFOBF-00019j-FW; Mon, 17 Feb 2014 14:24:17 +0100 From: Nicolas Dichtel To: sesse@samfundet.no Cc: hannes@stressinduktion.org, itk-intern@samfundet.no, davem@davemloft.net, netdev@vger.kernel.org, Nicolas Dichtel Subject: [PATCH net] gre: add link local route when local addr is any Date: Mon, 17 Feb 2014 14:22:21 +0100 Message-Id: <1392643341-4288-1-git-send-email-nicolas.dichtel@6wind.com> X-Mailer: git-send-email 1.8.5.4 In-Reply-To: <5301E59F.5090506@6wind.com> References: <5301E59F.5090506@6wind.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This bug was reported by Steinar H. Gunderson and was introduced by commit f7cb8886335d ("sit/gre6: don't try to add the same route two times"). root@morgental:~# ip tunnel add foo mode gre remote 1.2.3.4 ttl 64 root@morgental:~# ip link set foo up mtu 1468 root@morgental:~# ip -6 route show dev foo fe80::/64 proto kernel metric 256 but after the above commit, no such route shows up. There is no link local route because dev->dev_addr is 0 (because local ipv4 address is 0), hence no link local address is configured. In this scenario, the link local address is added manually: 'ip -6 addr add fe80::1 dev foo' and because prefix is /128, no link local route is added by the kernel. Even if the right things to do is to add the link local address with a /64 prefix, we need to restore the previous behavior to avoid breaking userpace. Reported-by: Steinar H. Gunderson Signed-off-by: Nicolas Dichtel --- net/ipv6/addrconf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index ad235690684c..fdbfeca36d63 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -2783,6 +2783,8 @@ static void addrconf_gre_config(struct net_device *dev) ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0); if (!ipv6_generate_eui64(addr.s6_addr + 8, dev)) addrconf_add_linklocal(idev, &addr); + else + addrconf_prefix_route(&addr, 64, dev, 0, 0); } #endif