Skip to content

Commit

Permalink
[libnozzle] fix del_ip removal of Ipv6 addresses when MTU < 1280
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Dec 14, 2018
1 parent d6f248e commit fb5f3d4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libnozzle/libnozzle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,18 @@ int nozzle_del_ip(nozzle_t nozzle, const char *ipaddr, const char *prefix)
goto out_clean;
}

err = _set_ip(nozzle, IP_DEL, ipaddr, prefix, 0);
savederrno = errno;
/*
* if user asks for an IPv6 address, but MTU < 1280
* the IP might not be configured on the interface and we only need to
* remove it from our internal database
*/
if ((ip->domain == AF_INET6) && (get_iface_mtu(nozzle) < 1280)) {
err = 0;
} else {
err = _set_ip(nozzle, IP_DEL, ipaddr, prefix, 0);
savederrno = errno;
}

if (!err) {
if (ip == ip_prev) {
nozzle->ip = ip->next;
Expand Down

0 comments on commit fb5f3d4

Please sign in to comment.