From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Westphal Subject: Re: [PATCH] Handle routing changes for the MASQUERADE target Date: Fri, 30 Nov 2012 22:40:32 +0100 Message-ID: <20121130214032.GF31969@breakpoint.cc> References: <20121130211147.GD31969@breakpoint.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Florian Westphal , netfilter-devel@vger.kernel.org To: Jozsef Kadlecsik Return-path: Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:35589 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755357Ab2K3Vkd (ORCPT ); Fri, 30 Nov 2012 16:40:33 -0500 Content-Disposition: inline In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: Jozsef Kadlecsik wrote: > > > + if (nat->masq_index && hooknum == NF_INET_POST_ROUTING && > > > + CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL && > > > + nat->masq_index != out->ifindex) { > > > + /* Outgoing interface changed, destroy conntrack. */ > > > + nf_ct_kill_acct(cf, ctinfo, skb); > > > + nf_ct_put(ct); > > > > Hmm. Is the nf_ct_put() correct? > > nf_ct_kill invokes death_by_timeout(), which also puts ct. > > nf_nat_ipv[46]_fn starts with "nf_ct_get", so that must be released. nf_ct_get() does not increase refcount :) Regards, Florian