diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-23 00:08:54 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-23 00:08:54 +0000 |
commit | 6884f665bd7bc101f56ff9047afaffbc06dc99e2 (patch) | |
tree | 9eb497068cdee02c112c2f55bd0def8ae6354e92 /networking/udhcp/common.h | |
parent | 68af8e7a084317191effa9b257483a50d994b11c (diff) | |
download | busybox-w32-6884f665bd7bc101f56ff9047afaffbc06dc99e2.tar.gz busybox-w32-6884f665bd7bc101f56ff9047afaffbc06dc99e2.tar.bz2 busybox-w32-6884f665bd7bc101f56ff9047afaffbc06dc99e2.zip |
dhcp: stop using magic constants; use (htonl(CONST) != a) - it's smaller
function old new delta
udhcp_get_packet 146 134 -12
get_raw_packet 368 353 -15
Diffstat (limited to 'networking/udhcp/common.h')
-rw-r--r-- | networking/udhcp/common.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index 179c21fdb..4f2d31c98 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h | |||
@@ -38,12 +38,18 @@ struct dhcpMessage { | |||
38 | uint8_t file[128]; | 38 | uint8_t file[128]; |
39 | uint32_t cookie; | 39 | uint32_t cookie; |
40 | uint8_t options[308]; /* 312 - cookie */ | 40 | uint8_t options[308]; /* 312 - cookie */ |
41 | }; | 41 | } ATTRIBUTE_PACKED; |
42 | 42 | ||
43 | struct udp_dhcp_packet { | 43 | struct udp_dhcp_packet { |
44 | struct iphdr ip; | 44 | struct iphdr ip; |
45 | struct udphdr udp; | 45 | struct udphdr udp; |
46 | struct dhcpMessage data; | 46 | struct dhcpMessage data; |
47 | } ATTRIBUTE_PACKED; | ||
48 | |||
49 | /* Let's see whether compiler understood us right */ | ||
50 | struct BUG_bad_sizeof_struct_udp_dhcp_packet { | ||
51 | char BUG_bad_sizeof_struct_udp_dhcp_packet | ||
52 | [sizeof(struct udp_dhcp_packet) != 576 ? -1 : 1]; | ||
47 | }; | 53 | }; |
48 | 54 | ||
49 | void udhcp_init_header(struct dhcpMessage *packet, char type); | 55 | void udhcp_init_header(struct dhcpMessage *packet, char type); |