public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@RedHat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Peter Wagner <tripolar@gmx.at>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] nfs-utils: fix addrinfo usage with musl-1.1.21
Date: Mon, 18 Feb 2019 12:59:56 -0500	[thread overview]
Message-ID: <530ec927-e9c6-490c-1382-8e5be1aea203@RedHat.com> (raw)
In-Reply-To: <EE3790BC-A5B4-4C34-9F21-7009579B3A25@oracle.com>


On 2/18/19 12:00 PM, Chuck Lever wrote:
>> I also took a look at how freeaddrinfo(3) in glibc works:
>>
>> void
>> freeaddrinfo (struct addrinfo *ai)
>> {
>>  struct addrinfo *p;
>>
>>  while (ai != NULL)
>>    {
>>      p = ai;
>>      ai = ai->ai_next;
>>      free (p->ai_canonname);
>>      free (p);
>>    }
>> }
>> It makes the assumption that ai_canonname is
>> free-able memory....
> Right, I seem to recall looking at this implementation when
> I wrote the IPv6 support for nfs-utils. That seems sensible
> to me.
> 
> However Peter's point is not all C libraries have to work
> that way, and I can see that argument too.
I agreed.... 
> 
> I have no objection to taking his fix as long as the hunk
> in host_numeric_addrinfo() is dropped while we figure out
> a more complete fix for that issue. 
Taking it out I can see us getting flagged for possible memory leaking....

Taking a look to why those frees were add... see commit 94ce1eb9
They should look very familiar to you ;-)  

> I would also like to
> see his fix use a helper like nfs_freeaddrinfo(), but that
> is only a suggestion.
That is a good suggestion... It definitely cleans up the code.

steved. 
> 
> 

  reply	other threads:[~2019-02-18 17:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-17 16:39 [PATCH] nfs-utils: fix addrinfo usage with musl-1.1.21 Peter Wagner
2019-02-17 17:40 ` Chuck Lever
2019-02-17 23:11   ` Peter Wagner
2019-02-18  2:21     ` Chuck Lever
2019-02-18 16:34       ` Steve Dickson
2019-02-18 17:00         ` Chuck Lever
2019-02-18 17:59           ` Steve Dickson [this message]
2019-02-18 18:23             ` Chuck Lever
2019-02-18 21:22               ` Peter Wagner
2019-02-18 21:26               ` Peter Wagner
2019-02-19  9:03                 ` Peter Wagner
2019-02-19 14:52                   ` Chuck Lever
2019-02-19 16:07                   ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=530ec927-e9c6-490c-1382-8e5be1aea203@RedHat.com \
    --to=steved@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tripolar@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox