If we get a NLMSG_DONE in response to trying to delete the existing ip

addresses associated with a link, then there are no existing ip addresses
to delete; don't print an error in this case.
This commit is contained in:
Nicholas J. Kain 2014-03-17 05:41:48 -04:00
parent 83610972c3
commit 3de2f42f4c

View File

@ -155,6 +155,8 @@ static ssize_t rtnl_do_send(int fd, uint8_t *sbuf, size_t slen,
return -1;
}
}
if (nlh->nlmsg_type == NLMSG_DONE)
return -2;
log_line("%s: (%s) netlink sendto returned an error.",
client_config.interface, __func__);
return -1;
@ -414,7 +416,7 @@ static void ipbcpfx_clear_others_do(const struct nlmsghdr *nlh, void *data)
tb[IFA_ADDRESS] ? rtattr_get_data(tb[IFA_ADDRESS]) : NULL,
tb[IFA_BROADCAST] ? rtattr_get_data(tb[IFA_BROADCAST]) : NULL,
ifm->ifa_prefixlen);
if (r < 0) {
if (r < 0 && r != -2) {
log_warning("%s: (%s) Failed to delete IP and broadcast addresses.",
client_config.interface, __func__);
}