Skip to content

Commit ce38188

Browse files
committed
dhcp: Ignore DHCP OFFER messages without assigned address
FreeRADIUS seems to respond that way if it can't allocate an address to the client.
1 parent 6e9cfe9 commit ce38188

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libcharon/plugins/dhcp/dhcp_socket.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,16 @@ static void handle_offer(private_dhcp_socket_t *this, dhcp_t *dhcp, int optlen)
489489
offer = host_create_from_chunk(AF_INET,
490490
chunk_from_thing(dhcp->your_address), 0);
491491

492+
if (offer->is_anyaddr(offer))
493+
{
494+
server = host_create_from_chunk(AF_INET,
495+
chunk_from_thing(dhcp->server_address), 0);
496+
DBG1(DBG_CFG, "ignoring DHCP OFFER %+H from %H", offer, server);
497+
server->destroy(server);
498+
offer->destroy(offer);
499+
return;
500+
}
501+
492502
this->mutex->lock(this->mutex);
493503
enumerator = this->discover->create_enumerator(this->discover);
494504
while (enumerator->enumerate(enumerator, &transaction))

0 commit comments

Comments
 (0)