This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: getifaddrs returns -1 with errno == 0, fix


On Sep 17, 2013, Alexandre Oliva <aoliva@redhat.com> wrote:

>> It turned out that getifaddrs() was indeed returning -1 without setting
>> errno, because the buffer allocated by __netlink_request wasn't large
>> enough to hold the response.  The received message was marked as
>> truncated, and we bailed out(_fail) without setting any errors.

>> Rather than just fail, I experimented with growing the buffer and
>> retrying.  I found out I had to consume the rest of the response to the
>> earlier request first, so I grew the buffer by just the right amount,
>> and that worked fine.

> Ping?

Ping?
https://sourceware.org/ml/libc-alpha/2013-09/msg00521.html

> for  ChangeLog

>         * sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_request): Grow
>         buffer and retry when message is fragmented.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]