From patchwork Tue Nov 13 17:25:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 997337 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mvPftjVS"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42vZK26jl5z9s3q for ; Wed, 14 Nov 2018 04:25:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731496AbeKNDYo (ORCPT ); Tue, 13 Nov 2018 22:24:44 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:38563 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727019AbeKNDYo (ORCPT ); Tue, 13 Nov 2018 22:24:44 -0500 Received: by mail-pf1-f194.google.com with SMTP id v76-v6so3567482pfa.5; Tue, 13 Nov 2018 09:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=67dmYR8m0JHJrZwHtocLSYBSrJJd0rAZVM/9PU7nihM=; b=mvPftjVS3d7MtjU3dLXqC5BTgiiKLbC6j+nPkIRvVNrqC4PqpBlj6sSJ9U0gkhC6mQ +GcTfSSBEDMQto7wkMbg71qUMVqBDSPJGyOjxtKPtH2t9MLrBqMDmam1Ua9RYlAZ/bHN Qw0i4qxvg9V/VqYmuS1cZOdGO6PGYagcdm6FfQc2FtKQMof0JH+tI4dWLNNnIT/KEUkm pxtiO1Ju4QC1K/4mPt/t04Ixzb5XFWrViHWAo8N6AlF1entrmMl7/jdRZ7xSvgNCY477 p3DrzvcLcZspCreDpl0d3xCvzVKlfCQsaFPmnpQXe0vS6hLOB20wbt8GG6K/PSto5Usy XISQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=67dmYR8m0JHJrZwHtocLSYBSrJJd0rAZVM/9PU7nihM=; b=HZkvOhW+EO7KdAnkB6ugzKg3jYBSXh7bCL8cNHdUXFaI0x/zVGgbLzRAerTTs3Kpwp UN6NAjmwqiAGc1vYorGw5Z+BvVsw3TGzUSpeaFpki/PKzuFeOdHXIyzarPGJeiEczQwK xF+RFPGw+AKVQAzzbWEkGyv4cHiqw1LINaPXkXhymdeXR4ieJdlcW9csd+N3yWnrztre sMS1g2IiwAmniEYE32e9pISIq/UAwjcecMchac1bFbLOmZWTbWr2T0Vk0lLdLsJrPpVa fkbbNa2dCkG2ysSBLsIivgdlQpHr2zyln6PUMrLoNDthkyrKWC9k6V+WmY+S7IgBoWqp cx+g== X-Gm-Message-State: AGRZ1gISBkODNZDYKkd/s0C+RB8UNd8kueCGw7UWWmJ5+dsF9BwqSUy9 U9WQyaVbW0LA9twwwWNA+cF/cjw+Wcg= X-Google-Smtp-Source: AJdET5fmp0uMOhu2BN9X3u4SXCm5nN+MNqsbB24n8RanZi3oFQwzUYpP50yscsaMVobnZ7xlEudcQQ== X-Received: by 2002:a63:61c8:: with SMTP id v191mr5611128pgb.242.1542129940928; Tue, 13 Nov 2018 09:25:40 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id i63-v6sm1984328pfe.83.2018.11.13.09.25.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 09:25:40 -0800 (PST) From: Xin Long To: network dev , netfilter-devel@vger.kernel.org Cc: davem@davemloft.net, pablo@netfilter.org, Hans Schillstrom Subject: [PATCH net] ipvs: call ip_vs_dst_notifier before ipv6_dev_notf Date: Wed, 14 Nov 2018 01:25:33 +0800 Message-Id: <4bfc74f2a94e3721afd5ee4dd3cb60f8e4b68c7c.1542129933.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.1.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org ip_vs_dst_event is supposed to clean up all dst used in ipvs' destinations when a net dev is going down. But it works only when the dst's dev is the same as the dev from the event. Now with the same priority but late registration, ip_vs_dst_notifier is always called after ipv6_dev_notf where the dst's dev is set to lo for NETDEV_DOWN event. As the dst's dev lo is not the same as the dev from the event in ip_vs_dst_event(), ipv6_dev_notf can actually never work. Also as these dst have to wait for dest_trash_timer to clean them up. It would cause some non-permanent kernel warnings: unregister_netdevice: waiting for br0 to become free. Usage count = 3 To fix it, call ip_vs_dst_notifier before ipv6_dev_notf by increasing its priority to ADDRCONF_NOTIFY_PRIORITY + 5. Fixes: 7a4f0761fce3 ("IPVS: init and cleanup restructuring") Reported-by: Li Shuang Signed-off-by: Xin Long Acked-by: Julian Anastasov --- net/netfilter/ipvs/ip_vs_ctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 83395bf6..aded477 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -3980,6 +3980,7 @@ static void __net_exit ip_vs_control_net_cleanup_sysctl(struct netns_ipvs *ipvs) static struct notifier_block ip_vs_dst_notifier = { .notifier_call = ip_vs_dst_event, + .priority = ADDRCONF_NOTIFY_PRIORITY + 5, }; int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs)