Re: [systemd-devel] unaligned write in dhcp_identifier_set_iaid

2015-05-19 Thread Tom Gundersen
On Tue, Feb 24, 2015 at 7:22 PM, Michael Olbrich
m.olbr...@pengutronix.de wrote:
 there is an unaligned write in dhcp_identifier_set_iaid() and I'm not quite
 sure what the correct fix is:

 int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, 
 uint32_t *_id) {
 [...]
 *_id = (id  0x) ^ (id  32);
 [...]
 }

 And this is called with:
 r = dhcp_identifier_set_iaid(client-index, client-mac_addr, 
 client-mac_addr_len, client-client_id.ns.iaid);

 And iaid is not unaligned because of the packing in struct sd_dhcp_client.
 I'm not sure why '_packed_' is used there. It this just to save some space,
 or is there a reason for this?

Thanks for the report. This seems to have fallen through the cracks.
Should be fixed in git, please verify.

Sorry for the delay.

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] unaligned write in dhcp_identifier_set_iaid

2015-02-24 Thread Michael Olbrich
Hi,

there is an unaligned write in dhcp_identifier_set_iaid() and I'm not quite
sure what the correct fix is:

int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, 
uint32_t *_id) {
[...]
*_id = (id  0x) ^ (id  32);
[...]
}

And this is called with:
r = dhcp_identifier_set_iaid(client-index, client-mac_addr, 
client-mac_addr_len, client-client_id.ns.iaid);

And iaid is not unaligned because of the packing in struct sd_dhcp_client.
I'm not sure why '_packed_' is used there. It this just to save some space,
or is there a reason for this?

Regards,
Michael

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel