diff options
author | Denys Vlasenko | 2009-07-07 14:59:30 +0200 |
---|---|---|
committer | Denys Vlasenko | 2009-07-07 14:59:30 +0200 |
commit | 95cc814dbd37a4cb5a69b5eac80bd3e5173fe908 (patch) | |
tree | e5adfbc603dd9b70371a77c5f1a5c19ba937f4ae /networking/udhcp/dhcpd.h | |
parent | a51543a3a486ca60018394dda2623fdf1f16a965 (diff) | |
download | busybox-95cc814dbd37a4cb5a69b5eac80bd3e5173fe908.zip busybox-95cc814dbd37a4cb5a69b5eac80bd3e5173fe908.tar.gz |
udhcpd: fix a bug in add_lease where it was reading at [-1]
It is not correct when we read lease file!
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpd.h')
-rw-r--r-- | networking/udhcp/dhcpd.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpd.h b/networking/udhcp/dhcpd.h index 67cb78c..4f6b73e 100644 --- a/networking/udhcp/dhcpd.h +++ b/networking/udhcp/dhcpd.h @@ -89,7 +89,7 @@ struct dyn_lease { * (dhcp packet has chaddr[16], not [6]) */ uint8_t lease_mac[6]; - uint8_t hostname[20]; + char hostname[20]; uint8_t pad[2]; /* total size is a multiply of 4 */ } PACKED; @@ -98,7 +98,8 @@ extern struct dyn_lease *g_leases; struct dyn_lease *add_lease( const uint8_t *chaddr, uint32_t yiaddr, - leasetime_t leasetime, uint8_t *hostname + leasetime_t leasetime, + const char *hostname, int hostname_len ) FAST_FUNC; int is_expired_lease(struct dyn_lease *lease) FAST_FUNC; struct dyn_lease *find_lease_by_mac(const uint8_t *mac) FAST_FUNC; |