projects
/
project
/
odhcpd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
router: don't announce prefixes with valid lifetime equal to 0
[project/odhcpd.git]
/
src
/
dhcpv4.c
diff --git
a/src/dhcpv4.c
b/src/dhcpv4.c
index
3fca886
..
81e537d
100644
(file)
--- a/
src/dhcpv4.c
+++ b/
src/dhcpv4.c
@@
-153,8
+153,7
@@
int setup_dhcpv4_interface(struct interface *iface, bool enable)
return -1;
}
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));
a->addr = ntohl(lease->ipaddr.s_addr);
memcpy(a->hwaddr, lease->mac.ether_addr_octet, sizeof(a->hwaddr));
@@
-194,10
+193,6
@@
int setup_dhcpv4_interface(struct interface *iface, bool enable)
free_dhcpv4_assignment(a);
}
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);
iface->dhcpv4_event.uloop.fd = sock;
iface->dhcpv4_event.handle_dgram = handle_dhcpv4;
odhcpd_register(&iface->dhcpv4_event);
@@
-540,7
+535,7
@@
static bool dhcpv4_assign(struct interface *iface,
if (start <= raddr && raddr <= end && dhcpv4_test(iface, raddr)) {
assign->addr = raddr;
list_add(&assign->head, &iface->dhcpv4_assignments);
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,
(assign->addr & 0xff000000) >> 24,
(assign->addr & 0x00ff0000) >> 16,
(assign->addr & 0x0000ff00) >> 8,
@@
-563,7
+558,7
@@
static bool dhcpv4_assign(struct interface *iface,
if (list_empty(&iface->dhcpv4_assignments)) {
assign->addr = try;
list_add(&assign->head, &iface->dhcpv4_assignments);
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,
(assign->addr & 0xff000000) >> 24,
(assign->addr & 0x00ff0000) >> 16,
(assign->addr & 0x0000ff00) >> 8,
@@
-586,7
+581,7
@@
static bool dhcpv4_assign(struct interface *iface,
try = (((try - start) + 1) % count) + start;
}
try = (((try - start) + 1) % count) + start;
}
- syslog(LOG_
DEBU
G, "can't assign any IP address -> address space is full");
+ syslog(LOG_
WARNIN
G, "can't assign any IP address -> address space is full");
return false;
}
return false;
}
@@
-627,7
+622,7
@@
static struct dhcpv4_assignment* dhcpv4_lease(struct interface *iface,
assigned = dhcpv4_assign(iface, a, raddr);
}
assigned = dhcpv4_assign(iface, a, raddr);
}
- if (a->leasetime
>= 60
)
+ if (a->leasetime)
my_leasetime = a->leasetime;
else
my_leasetime = iface->dhcpv4_leasetime;
my_leasetime = a->leasetime;
else
my_leasetime = iface->dhcpv4_leasetime;