summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-11-12 20:09:45 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-11-13 23:35:38 +0100
commit5191c99ef72a557f15de92b96e4702426e68cc99 (patch)
treed4d5c9a230dbbe47f0fdbee45135360b7d23f863 /gdhcp
parent7da565d421d475158f016af8ad7850ebd42646fb (diff)
downloadconnman-5191c99ef72a557f15de92b96e4702426e68cc99.tar.gz
connman-5191c99ef72a557f15de92b96e4702426e68cc99.tar.bz2
connman-5191c99ef72a557f15de92b96e4702426e68cc99.zip
gdhcp: Send DHCPNAK when receiving a REQUEST before a DISCOVER
Diffstat (limited to 'gdhcp')
-rw-r--r--gdhcp/server.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdhcp/server.c b/gdhcp/server.c
index 7322e6e2..e6f6d918 100644
--- a/gdhcp/server.c
+++ b/gdhcp/server.c
@@ -685,7 +685,8 @@ static gboolean listener_event(GIOChannel *channel, GIOCondition condition,
send_offer(dhcp_server, &packet, lease, requested_nip);
break;
case DHCPREQUEST:
- debug(dhcp_server, "Received REQUEST");
+ debug(dhcp_server, "Received REQUEST NIP %d",
+ requested_nip);
if (requested_nip == 0) {
requested_nip = packet.ciaddr;
if (requested_nip == 0)
@@ -693,13 +694,16 @@ static gboolean listener_event(GIOChannel *channel, GIOCondition condition,
}
if (lease && requested_nip == lease->lease_nip) {
+ debug(dhcp_server, "Sending ACK");
send_ACK(dhcp_server, &packet,
lease->lease_nip);
break;
}
- if (server_id_option)
+ if (server_id_option || lease == NULL) {
+ debug(dhcp_server, "Sending NAK");
send_NAK(dhcp_server, &packet);
+ }
break;
case DHCPDECLINE: