From 310d46c1edcefeb918125de0ee2e123c2940a70b Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 30 Nov 2010 00:31:01 +0000 Subject: [dhcp] Rename length fields for DHCP options Rename "len" to "used_len" and "max_len" to "alloc_len". Signed-off-by: Michael Brown --- src/include/ipxe/dhcpopts.h | 10 +++++----- src/include/ipxe/dhcppkt.h | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/include') diff --git a/src/include/ipxe/dhcpopts.h b/src/include/ipxe/dhcpopts.h index fea99d59d..d88036e3a 100644 --- a/src/include/ipxe/dhcpopts.h +++ b/src/include/ipxe/dhcpopts.h @@ -15,10 +15,10 @@ FILE_LICENCE ( GPL2_OR_LATER ); struct dhcp_options { /** Option block raw data */ void *data; - /** Option block length */ - size_t len; - /** Option block maximum length */ - size_t max_len; + /** Option block used length */ + size_t used_len; + /** Option block allocated length */ + size_t alloc_len; }; extern int dhcpopt_store ( struct dhcp_options *options, unsigned int tag, @@ -29,6 +29,6 @@ extern int dhcpopt_extensible_store ( struct dhcp_options *options, extern int dhcpopt_fetch ( struct dhcp_options *options, unsigned int tag, void *data, size_t len ); extern void dhcpopt_init ( struct dhcp_options *options, - void *data, size_t max_len ); + void *data, size_t alloc_len ); #endif /* _IPXE_DHCPOPTS_H */ diff --git a/src/include/ipxe/dhcppkt.h b/src/include/ipxe/dhcppkt.h index b004800d8..3179a6bb0 100644 --- a/src/include/ipxe/dhcppkt.h +++ b/src/include/ipxe/dhcppkt.h @@ -57,7 +57,8 @@ dhcppkt_put ( struct dhcp_packet *dhcppkt ) { * @ret len Used length */ static inline int dhcppkt_len ( struct dhcp_packet *dhcppkt ) { - return ( offsetof ( struct dhcphdr, options ) + dhcppkt->options.len ); + return ( offsetof ( struct dhcphdr, options ) + + dhcppkt->options.used_len ); } extern int dhcppkt_store ( struct dhcp_packet *dhcppkt, unsigned int tag, -- cgit v1.2.3-55-g7522