projects
/
project
/
odhcpd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor fixes
[project/odhcpd.git]
/
src
/
dhcpv4.c
diff --git
a/src/dhcpv4.c
b/src/dhcpv4.c
index
38b4f9b
..
6f15a0a
100644
(file)
--- a/
src/dhcpv4.c
+++ b/
src/dhcpv4.c
@@
-49,6
+49,7
@@
int init_dhcpv4(void)
int setup_dhcpv4_interface(struct interface *iface, bool enable)
{
if (iface->dhcpv4_event.uloop.fd > 0) {
int setup_dhcpv4_interface(struct interface *iface, bool enable)
{
if (iface->dhcpv4_event.uloop.fd > 0) {
+ uloop_fd_delete(&iface->dhcpv4_event.uloop);
close(iface->dhcpv4_event.uloop.fd);
iface->dhcpv4_event.uloop.fd = -1;
}
close(iface->dhcpv4_event.uloop.fd);
iface->dhcpv4_event.uloop.fd = -1;
}
@@
-65,7
+66,7
@@
int setup_dhcpv4_interface(struct interface *iface, bool enable)
setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &val, sizeof(val));
setsockopt(sock, IPPROTO_IP, IP_PKTINFO, &val, sizeof(val));
setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &val, sizeof(val));
setsockopt(sock, IPPROTO_IP, IP_PKTINFO, &val, sizeof(val));
- val = IPTOS_
CLASS_CS6
;
+ val = IPTOS_
PREC_INTERNETCONTROL
;
setsockopt(sock, IPPROTO_IP, IP_TOS, &val, sizeof(val));
val = IP_PMTUDISC_DONT;
setsockopt(sock, IPPROTO_IP, IP_TOS, &val, sizeof(val));
val = IP_PMTUDISC_DONT;
@@
-119,8
+120,8
@@
int setup_dhcpv4_interface(struct interface *iface, bool enable)
end = addr.s_addr & mask.s_addr;
if (ntohl(mask.s_addr) <= 0xffffff00) {
end = addr.s_addr & mask.s_addr;
if (ntohl(mask.s_addr) <= 0xffffff00) {
- iface->dhcpv4_start.s_addr = start | htonl(
2
0);
- iface->dhcpv4_end.s_addr = end | htonl(
199
);
+ iface->dhcpv4_start.s_addr = start | htonl(
10
0);
+ iface->dhcpv4_end.s_addr = end | htonl(
250
);
} else {
iface->dhcpv4_start.s_addr = start | htonl(10);
iface->dhcpv4_end.s_addr = end | htonl(59);
} else {
iface->dhcpv4_start.s_addr = start | htonl(10);
iface->dhcpv4_end.s_addr = end | htonl(59);
@@
-168,7
+169,7
@@
int setup_dhcpv4_interface(struct interface *iface, bool enable)
if (iface->dhcpv4_leasetime < 60)
if (iface->dhcpv4_leasetime < 60)
- iface->dhcpv4_leasetime =
18
00;
+ iface->dhcpv4_leasetime =
432
00;
iface->dhcpv4_event.uloop.fd = sock;
iface->dhcpv4_event.handle_dgram = handle_dhcpv4;
iface->dhcpv4_event.uloop.fd = sock;
iface->dhcpv4_event.handle_dgram = handle_dhcpv4;