Check return value of ifa_get_local_ip

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Stéphane Graber 2013-10-02 17:18:48 -04:00
parent c61eaadcf8
commit 51e7a87468
No known key found for this signature in database
GPG Key ID: C638974D64792D67

View File

@ -882,7 +882,11 @@ static int ip_addr_get(int family, int ifindex, void **res)
ip_info = (struct ip_req *)msg; ip_info = (struct ip_req *)msg;
if (ip_info->ifa.ifa_index == ifindex) { if (ip_info->ifa.ifa_index == ifindex) {
ifa_get_local_ip(family, ip_info, res); if (ifa_get_local_ip(family, ip_info, res) < 0) {
err = -1;
goto out;
}
/* Found a result, stop searching */ /* Found a result, stop searching */
if (*res) if (*res)
goto out; goto out;