From patchwork Wed Aug 28 05:22:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amerigo Wang X-Patchwork-Id: 270346 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 7D6842C0085 for ; Wed, 28 Aug 2013 15:25:32 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754222Ab3H1FZ3 (ORCPT ); Wed, 28 Aug 2013 01:25:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32476 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752669Ab3H1FZ2 (ORCPT ); Wed, 28 Aug 2013 01:25:28 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7S5PPjM020242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Aug 2013 01:25:25 -0400 Received: from cr0.redhat.com (vpn1-112-232.nay.redhat.com [10.66.112.232]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7S5N8Z9001193; Wed, 28 Aug 2013 01:25:19 -0400 From: Cong Wang To: netdev@vger.kernel.org Cc: "David S. Miller" , Cong Wang , David Stevens Subject: [PATCH net-next v10 10/11] vxlan: respect scope_id for ll addr Date: Wed, 28 Aug 2013 13:22:58 +0800 Message-Id: <1377667379-2315-11-git-send-email-amwang@redhat.com> In-Reply-To: <1377667379-2315-1-git-send-email-amwang@redhat.com> References: <1377667379-2315-1-git-send-email-amwang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Cong Wang As pointed out by David, we should take care of scope id for ll addr, and use it for route lookup. Cc: David S. Miller Cc: David Stevens Signed-off-by: Cong Wang --- drivers/net/vxlan.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 33a2c6e..a06355d 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1662,6 +1662,12 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, struct flowi6 fl6; u32 flags; + if (ipv6_addr_type(&dst->sin6.sin6_addr) & IPV6_ADDR_LINKLOCAL) { + dst->sin6.sin6_scope_id = ipv6_iface_scope_id(&dst->sin6.sin6_addr, + rdst->remote_ifindex); + rdst->remote_ifindex = dst->sin6.sin6_scope_id; + } + memset(&fl6, 0, sizeof(fl6)); fl6.flowi6_oif = rdst->remote_ifindex; fl6.daddr = dst->sin6.sin6_addr;