siphash24: change result argument to uint64_t
Change the "out" parameter from uint8_t[8] to uint64_t. On architectures which enforce pointer alignment this fixes crashes when we previously cast an unaligned array to uint64_t*, and on others this should at least improve performance as the compiler now aligns these properly. This also simplifies the code in most cases by getting rid of typecasts. The only place which we can't change is struct duid's en.id, as that is _packed_ and public API, so we can't enforce alignment of the "id" field and have to use memcpy instead.
This commit is contained in:
@@ -62,7 +62,7 @@ int config_parse_ifalias(const char *unit, const char *filename, unsigned line,
|
||||
const char *section, unsigned section_line, const char *lvalue,
|
||||
int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
||||
int net_get_unique_predictable_data(struct udev_device *device, uint8_t result[8]);
|
||||
int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result);
|
||||
const char *net_get_name(struct udev_device *device);
|
||||
|
||||
void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
|
||||
|
||||
Reference in New Issue
Block a user