iface->dhcpv4_end.s_addr = end | htonl(12);
}
}
-
-
}
/* Parse static entries */
return -1;
}
- if (lease->dhcpv4_leasetime >= 60)
- a->leasetime = lease->dhcpv4_leasetime;
+ a->leasetime = lease->dhcpv4_leasetime;
a->addr = ntohl(lease->ipaddr.s_addr);
memcpy(a->hwaddr, lease->mac.ether_addr_octet, sizeof(a->hwaddr));
free_dhcpv4_assignment(a);
}
-
- if (iface->dhcpv4_leasetime < 60)
- iface->dhcpv4_leasetime = 43200;
-
iface->dhcpv4_event.uloop.fd = sock;
iface->dhcpv4_event.handle_dgram = handle_dhcpv4;
odhcpd_register(&iface->dhcpv4_event);
*/
}
- syslog(LOG_WARNING, "received %s from %x:%x:%x:%x:%x:%x",
+ syslog(LOG_WARNING, "received %s from %02x:%02x:%02x:%02x:%02x:%02x",
dhcpv4_msg_to_string(reqmsg),
req->chaddr[0],req->chaddr[1],req->chaddr[2],
req->chaddr[3],req->chaddr[4],req->chaddr[5]);
* reply is send directly to IP,
* MAC is assumed to be the same as the request
*/
- syslog(LOG_WARNING, "sending %s to %x:%x:%x:%x:%x:%x - %s",
+ syslog(LOG_WARNING, "sending %s to %02x:%02x:%02x:%02x:%02x:%02x - %s",
dhcpv4_msg_to_string(msg),
req->chaddr[0],req->chaddr[1],req->chaddr[2],
req->chaddr[3],req->chaddr[4],req->chaddr[5],
if (start <= raddr && raddr <= end && dhcpv4_test(iface, raddr)) {
assign->addr = raddr;
list_add(&assign->head, &iface->dhcpv4_assignments);
- syslog(LOG_DEBUG, "assigning the IP the client asked for: %u.%u.%u.%u",
+ syslog(LOG_INFO, "assigning the IP the client asked for: %u.%u.%u.%u",
(assign->addr & 0xff000000) >> 24,
(assign->addr & 0x00ff0000) >> 16,
(assign->addr & 0x0000ff00) >> 8,
if (list_empty(&iface->dhcpv4_assignments)) {
assign->addr = try;
list_add(&assign->head, &iface->dhcpv4_assignments);
- syslog(LOG_DEBUG, "assigning mapped IP (empty list): %u.%u.%u.%u",
+ syslog(LOG_INFO, "assigning mapped IP (empty list): %u.%u.%u.%u",
(assign->addr & 0xff000000) >> 24,
(assign->addr & 0x00ff0000) >> 16,
(assign->addr & 0x0000ff00) >> 8,
try = (((try - start) + 1) % count) + start;
}
- syslog(LOG_DEBUG, "can't assign any IP address -> address space is full");
+ syslog(LOG_WARNING, "can't assign any IP address -> address space is full");
return false;
}
assigned = dhcpv4_assign(iface, a, raddr);
}
- if (a->leasetime >= 60)
+ if (a->leasetime)
my_leasetime = a->leasetime;
else
my_leasetime = iface->dhcpv4_leasetime;