Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp690861imm; Fri, 28 Sep 2018 05:22:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV60obdS8JpuOwJidKgyY2wlHolVBUCAsXbay0HXYjv+FemMc5M+oBH06Asx6ytu1kcu5mGkh X-Received: by 2002:a17:902:9893:: with SMTP id s19-v6mr16227532plp.130.1538137358318; Fri, 28 Sep 2018 05:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538137358; cv=none; d=google.com; s=arc-20160816; b=E/KZ/dkRwjOzD9K1pU0nPJa4zAGSk7EjA9nZKHg486TGVFYI8dGIUNX6mc65t2Z1Le k8WvL46tBzfEYkmrof7do+BvbRe2mubBIWkbZlB6xvRYtFqE0+xwiG53hAhE/k4JT5D9 7TpoXMLUbJHUZNyZDShUUKMlkoHEudqLTDzCh09n1ConahCLpSgwA2l21NDTe/DBefNY ugJ6sjIrnC9vuiRGAYy7yXY2WpQ9PaPXG+WvS0fu+YzIQ87Abqbo8xKRpUtCA1C7mTNL pgJJeI3c7zrcY6n+MHbLAR5miQnL81qxoWEE4l7LlgD/UFwST6bt4aozEi2mdeDGeXRj fbSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WJRYb8+Gh4JjKR8uzpUl7LPovMyr5GAfCRRFJTMkm54=; b=C3PQeMB13UZBqCmckmLl4oY3PJpFyarHDj8ec7FpOwG4XIcgWcnl4Lq1s1V9imk3vH TcxfijW8mmPa/zd7HioQIXvx6rIXbyXlSKcYU1R3g/kSiCbyqcfQfm+SRJyqLROcoDh3 65TkDyIztkAvB0gtJSpBYIW4PCpqyFX6wK1deFMAaOuOfnumNz3v5swqctJPypILB95g q5ukowOtudhVZAQGw+dnSVuIhS3Pbc8I2b+3eMkCE6N3d2e+euhU6l/Arb2J22J9ItX0 oHGRM6zaAYsSi0om9aJpkfefOF9oL3P+8ekW1exXMm4/0rv3mGJodx2EQhKhOT/sjyud 1+DQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si4750775plr.326.2018.09.28.05.22.22; Fri, 28 Sep 2018 05:22:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728827AbeI1Spr (ORCPT + 99 others); Fri, 28 Sep 2018 14:45:47 -0400 Received: from mail.us.es ([193.147.175.20]:47732 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727389AbeI1Spr (ORCPT ); Fri, 28 Sep 2018 14:45:47 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id E00EE1EC2D0 for ; Fri, 28 Sep 2018 14:22:13 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id D09E2DA85E for ; Fri, 28 Sep 2018 14:22:13 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id BA585DA87F; Fri, 28 Sep 2018 14:22:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id E0B1ADA846; Fri, 28 Sep 2018 14:22:11 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Fri, 28 Sep 2018 14:22:11 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (sys.soleta.eu [212.170.55.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id A735D4265A5F; Fri, 28 Sep 2018 14:22:11 +0200 (CEST) Date: Fri, 28 Sep 2018 14:22:11 +0200 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: Tan Hu Cc: kadlec@blackhole.kfki.hu, fw@strlen.de, davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, jiang.biao2@zte.com.cn Subject: Re: [PATCH] netfilter: masquerade: don't flush all conntracks if only one address deleted on device Message-ID: <20180928122211.vxjfcrme6oiukjol@salvia> References: <1536309213-19632-1-git-send-email-tan.hu@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1536309213-19632-1-git-send-email-tan.hu@zte.com.cn> User-Agent: NeoMutt/20170113 (1.7.2) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 07, 2018 at 04:33:33PM +0800, Tan Hu wrote: > We configured iptables as below, which only allowed incoming data on > established connections: > > iptables -t mangle -A PREROUTING -m state --state ESTABLISHED -j ACCEPT > iptables -t mangle -P PREROUTING DROP > > When deleting a secondary address, current masquerade implements would > flush all conntracks on this device. All the established connections on > primary address also be deleted, then subsequent incoming data on the > connections would be dropped wrongly because it was identified as NEW > connection. > > So when an address was delete, it should only flush connections related > with the address. Applied to nf-next, thanks.