]> git.ipfire.org Git - thirdparty/glibc.git/commit
getifaddrs: Don't return ifa entries with NULL names [BZ #21812]
authorDaniel Alvarez <dalvarez@redhat.com>
Fri, 29 Jun 2018 07:44:55 +0000 (09:44 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 29 Jun 2018 07:44:55 +0000 (09:44 +0200)
commitc1f86a33ca32e26a9d6e29fc961e5ecb5e2e5eb4
tree2176bd36948fdf0af2387bcc1bc309f896b948c3
parent0b11b6491cc01b5ce5fea1302f8591f25e8c4d80
getifaddrs: Don't return ifa entries with NULL names [BZ #21812]

A lookup operation in map_newlink could turn into an insert because of
holes in the interface part of the map.  This leads to incorrectly set
the name of the interface to NULL when the interface is not present
for the address being processed (most likely because the interface was
added between the RTM_GETLINK and RTM_GETADDR calls to the kernel).
When such changes are detected by the kernel, it'll mark the dump as
"inconsistent" by setting NLM_F_DUMP_INTR flag on the next netlink
message.

This patch checks this condition and retries the whole operation.
Hopes are that next time the interface corresponding to the address
entry is present in the list and correct name is returned.
ChangeLog
sysdeps/unix/sysv/linux/ifaddrs.c