From patchwork Sat Apr 11 01:54:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin KaFai Lau X-Patchwork-Id: 460297 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 9B4FD1402FA for ; Sat, 11 Apr 2015 11:54:45 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=fb.com header.i=@fb.com header.b=jy9pkc3F; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755234AbbDKBye (ORCPT ); Fri, 10 Apr 2015 21:54:34 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:37773 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753841AbbDKByc (ORCPT ); Fri, 10 Apr 2015 21:54:32 -0400 Received: from pps.filterd (m0004348 [127.0.0.1]) by m0004348.ppops.net (8.14.5/8.14.5) with SMTP id t3B1ra79009407 for ; Fri, 10 Apr 2015 18:54:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=iL1uxCYmY/91dRHFfEa8U6AzE5NKS6BsP8BiHkti0rU=; b=jy9pkc3FIBC5FnjJL1VWhJLnKTOfUzHKiF79uXQxLeHkA7NXXgZCuAhwGXZDoPLxEWZ1 Y8+4ePbisvxBrQU/k5uAwg0k2E8At7Bn4m/V3v33ueFrRtGrCRAvm+2D91qaiubZtN0U zleNHDtkPu6BXH9TLQg4Yp5FXdQmjFcrlL0= Received: from mail.thefacebook.com ([199.201.64.23]) by m0004348.ppops.net with ESMTP id 1tpry9032j-2 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Fri, 10 Apr 2015 18:54:31 -0700 Received: from mx-out.facebook.com (192.168.52.13) by PRN-CHUB06.TheFacebook.com (192.168.16.16) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 10 Apr 2015 18:54:31 -0700 Received: from facebook.com (2401:db00:20:7029:face:0:33:0) by mx-out.facebook.com (10.212.236.87) with ESMTP id b1573798dfed11e4aeea0002c9521c9e-f31d32c0 for ; Fri, 10 Apr 2015 18:54:30 -0700 Received: by devbig242.prn2.facebook.com (Postfix, from userid 6611) id 80A3A1F3724; Fri, 10 Apr 2015 18:54:29 -0700 (PDT) From: Martin KaFai Lau To: CC: Hannes Frederic Sowa , Subject: [RFC PATCH 06/10] ipv6: Avoid deleting RTF_CACHE route from ip6_route_del() Date: Fri, 10 Apr 2015 18:54:09 -0700 Message-ID: <1428717253-1006248-7-git-send-email-kafai@fb.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1428717253-1006248-1-git-send-email-kafai@fb.com> References: <1428717253-1006248-1-git-send-email-kafai@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68, 1.0.33, 0.0.0000 definitions=2015-04-10_07:2015-04-10, 2015-04-10, 1970-01-01 signatures=0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Before patch 'Allow pmtu update on /128 via gateway route', RTF_CACHE route was not created for DST_HOST. It also requires changes on both delete code path and rt6_select() code patch. This patch fixes the delete code path to avoid deleting the RTF_CACHE route by 'ip -6 r del...' Signed-off-by: Martin KaFai Lau Reviewed-by: Hannes Frederic Sowa --- net/ipv6/route.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 75f3b5d..5d0fd6c 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1780,6 +1780,9 @@ static int ip6_route_del(struct fib6_config *cfg) if (fn) { for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { + if ((rt->rt6i_flags & RTF_CACHE) && + !(cfg->fc_flags & RTF_CACHE)) + continue; if (cfg->fc_ifindex && (!rt->dst.dev || rt->dst.dev->ifindex != cfg->fc_ifindex)) @@ -2424,6 +2427,9 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh, if (rtm->rtm_type == RTN_LOCAL) cfg->fc_flags |= RTF_LOCAL; + if (rtm->rtm_flags & RTM_F_CLONED) + cfg->fc_flags |= RTF_CACHE; + cfg->fc_nlinfo.portid = NETLINK_CB(skb).portid; cfg->fc_nlinfo.nlh = nlh; cfg->fc_nlinfo.nl_net = sock_net(skb->sk);