diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-30 23:41:23 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-30 23:41:23 +0200 |
commit | b7d19cc400f14ccd64a1fedebe14022fe115029a (patch) | |
tree | cd4a50e2694628413a2460d3e1d2a706462d0e2b /networking/udhcp/common.h | |
parent | c88c1a01904b5791dfd1ca5342c805a9f392e17f (diff) | |
download | busybox-w32-b7d19cc400f14ccd64a1fedebe14022fe115029a.tar.gz busybox-w32-b7d19cc400f14ccd64a1fedebe14022fe115029a.tar.bz2 busybox-w32-b7d19cc400f14ccd64a1fedebe14022fe115029a.zip |
dhcp: readability cleanups and small code shrink
function old new delta
udhcp_run_script 654 617 -37
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/common.h')
-rw-r--r-- | networking/udhcp/common.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index c9dd0bb25..75b787a80 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h | |||
@@ -57,10 +57,20 @@ struct ip_udp_dhcp_packet { | |||
57 | struct dhcp_packet data; | 57 | struct dhcp_packet data; |
58 | } PACKED; | 58 | } PACKED; |
59 | 59 | ||
60 | struct udp_dhcp_packet { | ||
61 | struct udphdr udp; | ||
62 | struct dhcp_packet data; | ||
63 | } PACKED; | ||
64 | |||
65 | enum { | ||
66 | IP_UPD_DHCP_SIZE = sizeof(struct ip_udp_dhcp_packet) - CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS, | ||
67 | UPD_DHCP_SIZE = sizeof(struct udp_dhcp_packet) - CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS, | ||
68 | DHCP_SIZE = sizeof(struct dhcp_packet) - CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS, | ||
69 | }; | ||
70 | |||
60 | /* Let's see whether compiler understood us right */ | 71 | /* Let's see whether compiler understood us right */ |
61 | struct BUG_bad_sizeof_struct_ip_udp_dhcp_packet { | 72 | struct BUG_bad_sizeof_struct_ip_udp_dhcp_packet { |
62 | char BUG_bad_sizeof_struct_ip_udp_dhcp_packet | 73 | char c[IP_UPD_DHCP_SIZE == 576 ? 1 : -1]; |
63 | [(sizeof(struct ip_udp_dhcp_packet) != 576 + CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS) ? -1 : 1]; | ||
64 | }; | 74 | }; |
65 | 75 | ||
66 | 76 | ||