mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
dhclient: support supersede statement for option 54
Submitted by: Fabian Kurtz <fabian.kurtz@udo.edu>
This commit is contained in:
parent
c1e3838d95
commit
14580e78e5
1 changed files with 13 additions and 4 deletions
|
|
@ -862,6 +862,8 @@ void
|
|||
state_bound(void *ipp)
|
||||
{
|
||||
struct interface_info *ip = ipp;
|
||||
u_int8_t *dp = NULL;
|
||||
int len;
|
||||
|
||||
ASSERT_STATE(state, S_BOUND);
|
||||
|
||||
|
|
@ -869,10 +871,17 @@ state_bound(void *ipp)
|
|||
make_request(ip, ip->client->active);
|
||||
ip->client->xid = ip->client->packet.xid;
|
||||
|
||||
if (ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].len == 4) {
|
||||
memcpy(ip->client->destination.iabuf, ip->client->active->
|
||||
options[DHO_DHCP_SERVER_IDENTIFIER].data, 4);
|
||||
ip->client->destination.len = 4;
|
||||
if (ip->client->config->default_actions[DHO_DHCP_SERVER_IDENTIFIER] ==
|
||||
ACTION_SUPERSEDE) {
|
||||
dp = ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].data;
|
||||
len = ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].len;
|
||||
} else {
|
||||
dp = ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].data;
|
||||
len = ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].len;
|
||||
}
|
||||
if (len == 4) {
|
||||
memcpy(ip->client->destination.iabuf, dp, len);
|
||||
ip->client->destination.len = len;
|
||||
} else
|
||||
ip->client->destination = iaddr_broadcast;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue