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.
This commit is contained in:
Thomas Haller 2017-04-27 13:58:38 +02:00
parent f15c4961ad
commit 951e5f5bf8
3 changed files with 7 additions and 7 deletions

View file

@ -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);
}

View file

@ -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;

View file

@ -367,7 +367,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);
@ -376,7 +376,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,