diff options
author | Thomas Haller <thaller@redhat.com> | 2018-12-14 17:04:21 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-12-19 09:23:08 +0100 |
commit | 3102b49f623c499638c8f284c2f651829f904dc2 (patch) | |
tree | 95844e19b70d2a0d61688e5735511518068b6831 /src/nm-ip6-config.c | |
parent | 9a6a35401322e2b387fb164f7f2d68963f4a1512 (diff) | |
download | NetworkManager-3102b49f623c499638c8f284c2f651829f904dc2.tar.gz |
core: allow addresses with zero prefix length
There is really no problem here, allow it.
Previously we would assert against a non-zero prefix length.
But I am not sure that all callers really ensured that this
couldn't happen. Anyway, there is no problem we such addresses,
really.
Only we need to make sure that nm_ip4_config_add_dependent_routes()
and nm_ip6_config_add_dependent_routes() don't add prefix routes for
such addresses (which is the case now).
Diffstat (limited to 'src/nm-ip6-config.c')
-rw-r--r-- | src/nm-ip6-config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index c1864d338a..6d54809edd 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -485,6 +485,8 @@ nm_ip6_config_add_dependent_routes (NMIP6Config *self, if (NM_FLAGS_HAS (my_addr->n_ifa_flags, IFA_F_NOPREFIXROUTE)) continue; + if (my_addr->plen == 0) + continue; has_peer = !IN6_IS_ADDR_UNSPECIFIED (&my_addr->peer_address); @@ -1593,7 +1595,7 @@ nm_ip6_config_add_address (NMIP6Config *self, const NMPlatformIP6Address *new) { g_return_if_fail (self); g_return_if_fail (new); - g_return_if_fail (new->plen > 0 && new->plen <= 128); + g_return_if_fail (new->plen <= 128); g_return_if_fail (NM_IP6_CONFIG_GET_PRIVATE (self)->ifindex > 0); _add_address (self, NULL, new); |