summaryrefslogtreecommitdiffhomepage
path: root/networking/udhcp/dhcpd.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-06-16 10:23:01 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-06-16 10:23:01 +0200
commit1d924f59b1854e9638c63a743642e63c1bef38b9 (patch)
tree9cee2a7da051fb217fb610e7509d5dfd3657da47 /networking/udhcp/dhcpd.c
parent47f2d7ef7d4dbeea19a55f9d73ef826f9d06650f (diff)
udhcp: rename fields in struct dhcpOfferedAddr
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r--networking/udhcp/dhcpd.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index ccdfd362b..61e4a1d95 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -170,8 +170,8 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
if (static_lease_ip) {
bb_info_msg("Found static lease: %x", static_lease_ip);
- memcpy(&static_lease.chaddr, &packet.chaddr, 16);
- static_lease.yiaddr = static_lease_ip;
+ memcpy(&static_lease.lease_mac16, &packet.chaddr, 16);
+ static_lease.lease_nip = static_lease_ip;
static_lease.expires = 0;
lease = &static_lease;
@@ -204,19 +204,19 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
DEBUG("server_id = %08x", ntohl(server_id_aligned));
if (server_id_aligned == server_config.server
&& requested
- && requested_aligned == lease->yiaddr
+ && requested_aligned == lease->lease_nip
) {
- send_ACK(&packet, lease->yiaddr);
+ send_ACK(&packet, lease->lease_nip);
}
} else if (requested) {
/* INIT-REBOOT State */
- if (lease->yiaddr == requested_aligned)
- send_ACK(&packet, lease->yiaddr);
+ if (lease->lease_nip == requested_aligned)
+ send_ACK(&packet, lease->lease_nip);
else
send_NAK(&packet);
- } else if (lease->yiaddr == packet.ciaddr) {
+ } else if (lease->lease_nip == packet.ciaddr) {
/* RENEWING or REBINDING State */
- send_ACK(&packet, lease->yiaddr);
+ send_ACK(&packet, lease->lease_nip);
} else { /* don't know what to do!!!! */
send_NAK(&packet);
}
@@ -231,10 +231,11 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
if (lease) {
if (lease_expired(lease)) {
/* probably best if we drop this lease */
- memset(lease->chaddr, 0, 16);
- /* make some contention for this address */
- } else
+ memset(lease->lease_mac16, 0, 16);
+ } else {
+ /* make some contention for this address */
send_NAK(&packet);
+ }
} else {
uint32_t r = ntohl(requested_aligned);
if (r < server_config.start_ip
@@ -252,7 +253,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
case DHCPDECLINE:
DEBUG("Received DECLINE");
if (lease) {
- memset(lease->chaddr, 0, 16);
+ memset(lease->lease_mac16, 0, 16);
lease->expires = time(NULL) + server_config.decline_time;
}
break;