Commit cfd8cf54 authored by Thomas Haller's avatar Thomas Haller

core: make dad_counter argument guint32 type

The dad_counter is hashed into the resulting address. Since we
want the hashing to be independent of the architecture, we always
hash 32 bit of dad_counter. Make the dad_counter argument of
type guint32 for consistency.

In practice this has no effect because:
  - for all our (current!) architectues, guint is the same as
    guint32.
  - all callers of nm_utils_ipv6_addr_set_stable_privacy() keep
    their dad-counter argument as guint8, so they never even pass
    numbers larger then 255.
  - nm_utils_ipv6_addr_set_stable_privacy() limits dad_counter
    further against RFC7217_IDGEN_RETRIES.

(cherry picked from commit 951e5f5b)
parent 9f7433f8
......@@ -1358,7 +1358,7 @@ nm_device_get_ip_iface_identifier (NMDevice *self, NMUtilsIPv6IfaceId *iid, gboo
if (!ignore_token) {
s_ip6 = (NMSettingIP6Config *)
nm_device_get_applied_setting (self, NM_TYPE_SETTING_IP6_CONFIG);
nm_device_get_applied_setting (self, NM_TYPE_SETTING_IP6_CONFIG);
g_return_val_if_fail (s_ip6, FALSE);
token = nm_setting_ip6_config_get_token (s_ip6);
}
......
......@@ -3329,7 +3329,7 @@ nm_utils_ipv6_interface_identifier_get_from_addr (NMUtilsIPv6IfaceId *iid,
*/
gboolean
nm_utils_ipv6_interface_identifier_get_from_token (NMUtilsIPv6IfaceId *iid,
const char *token)
const char *token)
{
struct in6_addr i6_token;
......@@ -3578,7 +3578,7 @@ _set_stable_privacy (NMUtilsStableType stable_type,
struct in6_addr *addr,
const char *ifname,
const char *network_id,
guint dad_counter,
guint32 dad_counter,
guint8 *secret_key,
gsize key_len,
GError **error)
......@@ -3653,7 +3653,7 @@ nm_utils_ipv6_addr_set_stable_privacy_impl (NMUtilsStableType stable_type,
struct in6_addr *addr,
const char *ifname,
const char *network_id,
guint dad_counter,
guint32 dad_counter,
guint8 *secret_key,
gsize key_len,
GError **error)
......@@ -3675,7 +3675,7 @@ nm_utils_ipv6_addr_set_stable_privacy (NMUtilsStableType stable_type,
struct in6_addr *addr,
const char *ifname,
const char *network_id,
guint dad_counter,
guint32 dad_counter,
GError **error)
{
gs_free guint8 *secret_key = NULL;
......
......@@ -411,7 +411,7 @@ gboolean nm_utils_ipv6_addr_set_stable_privacy_impl (NMUtilsStableType stable_ty
struct in6_addr *addr,
const char *ifname,
const char *network_id,
guint dad_counter,
guint32 dad_counter,
guint8 *secret_key,
gsize key_len,
GError **error);
......@@ -420,7 +420,7 @@ gboolean nm_utils_ipv6_addr_set_stable_privacy (NMUtilsStableType id_type,
struct in6_addr *addr,
const char *ifname,
const char *network_id,
guint dad_counter,
guint32 dad_counter,
GError **error);
char *nm_utils_hw_addr_gen_random_eth (const char *current_mac_address,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment