Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions shared/net/application_layer/dhcp_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down