From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Kodanev Subject: Re: sctp netns "unregister_netdevice: waiting for lo to become free. Usage count = 1" Date: Fri, 2 Feb 2018 15:17:00 +0300 Message-ID: <3ec4782b-272a-0509-40fc-bc88b827e102@oracle.com> References: <2a9c25b0-9ee7-baf6-f212-2c94b06941ea@nokia.com> <20180130155909.GA25399@hmswarspite.think-freely.org> <085a2abc-36e3-74fd-8c3a-9352bdd05cf8@nokia.com> <20180130210353.GB25399@hmswarspite.think-freely.org> <20180131123105.GB23692@hmswarspite.think-freely.org> <893a7e36-5124-ab2b-9408-0de5fac392b5@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Tommi Rantala , Neil Horman , Vlad Yasevich , linux-sctp@vger.kernel.org, "netdev@vger.kernel.org" , Marcelo Ricardo Leitner To: Tommi Rantala Return-path: Received: from userp2120.oracle.com ([156.151.31.85]:36510 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751581AbeBBMSM (ORCPT ); Fri, 2 Feb 2018 07:18:12 -0500 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 02.02.2018 11:27, Tommi Rantala wrote: > 2018-02-02 1:57 GMT+02:00 Alexey Kodanev : >> For ipv6 part, shouldn't we release 'bdst' there if the previous address >> match is better and we continue to the next iteration? > > Good catch! > On the second thought, I think, we should also check 'bdst' ptr for the error earlier, i.e. right after 'bdst = ip6_dst_lookup_flow(...)'. I'll prepare the patch. Thanks, Alexey > Didn't see that one. > > Tommi > >> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c >> index 5d4c15b..a044096 100644 >> --- a/net/sctp/ipv6.c >> +++ b/net/sctp/ipv6.c >> @@ -336,8 +336,11 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, >> } >> >> bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a); >> - if (matchlen > bmatchlen) >> + if (matchlen > bmatchlen) { >> + if (!IS_ERR(bdst)) >> + dst_release(bdst); >> continue; >> + } >> >> if (!IS_ERR_OR_NULL(dst)) >> dst_release(dst); >> >> Thanks, >> Alexey