interface: fix default netmask size for AF_INET6 addresses (closes #130)

This commit is contained in:
Ariadne Conill 2020-12-02 11:05:40 -07:00
parent e1fb4c6087
commit 259851a829

View file

@ -93,7 +93,7 @@ lif_address_format_cidr(const struct lif_interface *iface, struct lif_dict_entry
if (!addr->netmask) if (!addr->netmask)
{ {
/* if netmask is not set, default to 255.255.255.0, ifupdown does so too */ /* if netmask is not set, default to 255.255.255.0, ifupdown does so too */
addr->netmask = 24; addr->netmask = addr->domain == AF_INET6 ? 64 : 24;
struct lif_dict_entry *entry = lif_dict_find(&iface->vars, "netmask"); struct lif_dict_entry *entry = lif_dict_find(&iface->vars, "netmask");
if (entry != NULL) if (entry != NULL)