diff --git a/shared/net/application_layer/dhcp_daemon.c b/shared/net/application_layer/dhcp_daemon.c index 28c95612..8a9d0bed 100644 --- a/shared/net/application_layer/dhcp_daemon.c +++ b/shared/net/application_layer/dhcp_daemon.c @@ -329,12 +329,17 @@ static void dhcp_apply_offer(dhcp_packet *p, dhcp_request *req, uint32_t xid) { uint32_t t1_net; memcpy(&t1_net, &p->options[idx+2], 4); cfg_local.rt->t1 = __builtin_bswap32(t1_net); + }else { + cfg_local.rt->t1 = cfg_local.rt->lease / 2; } + idx = dhcp_parse_option(p, 59); if (idx != UINT16_MAX && p->options[idx+1] >= 4) { uint32_t t2_net; memcpy(&t2_net, &p->options[idx+2], 4); cfg_local.rt->t2 = __builtin_bswap32(t2_net); + } else { + cfg_local.rt->t2 = (cfg_local.rt->lease / 8) * 7; } idx = dhcp_parse_option(p, 54);