projects
/
oweals
/
odhcpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e439847
)
dhcpv4: send NAK to broacast address
author
Christian Mehlis
<christian@m3hlis.de>
Mon, 18 Aug 2014 11:36:18 +0000
(13:36 +0200)
committer
Christian Mehlis
<christian@m3hlis.de>
Mon, 18 Aug 2014 11:36:18 +0000
(13:36 +0200)
src/dhcpv4.c
patch
|
blob
|
history
diff --git
a/src/dhcpv4.c
b/src/dhcpv4.c
index 58838476d522b424f15654184c0397ad93c5cca1..ebddb225b570feba5626ed73112ec5f30eef0ef8 100644
(file)
--- a/
src/dhcpv4.c
+++ b/
src/dhcpv4.c
@@
-458,6
+458,13
@@
static void handle_dhcpv4(void *addr, void *data, size_t len,
*/
dest.sin_addr.s_addr = INADDR_BROADCAST;
dest.sin_port = htons(DHCPV4_CLIENT_PORT);
+ } else if (!req->ciaddr.s_addr && msg == DHCPV4_MSG_NAK) {
+ /*
+ * client has no previous configuration -> no IP, so we need to reply
+ * with a broadcast packet
+ */
+ dest.sin_addr.s_addr = INADDR_BROADCAST;
+ dest.sin_port = htons(DHCPV4_CLIENT_PORT);
} else {
/*
* send reply to the newly (in this proccess) allocated IP