The previous way was giving the following warning with gcc 4.7:
CC gdhcp/common.o
gdhcp/common.c: In function 'dhcp_add_simple_option':
gdhcp/common.c:275:38: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing
Change it slightly so not to give this warning.
data <<= 8 * (4 - len);
#endif
- dhcp_put_unaligned(data, (uint32_t *) &option[OPT_DATA]);
+ dhcp_put_unaligned(data, (uint32_t *)(option + OPT_DATA));
dhcp_add_binary_option(packet, option);
return;