diff options
author | Thomas Haller <thaller@redhat.com> | 2018-10-29 12:11:26 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-11-13 19:09:34 +0100 |
commit | c3e7e6170dae14d553e650d9bd1d8b449e936f90 (patch) | |
tree | ac73cf89918fcf46bfdeae886ffd2b93975af132 /libnm-core | |
parent | ce1cfd7232273dcb577f9fc783b7694dd191ae86 (diff) |
dhcp: cleanup initializing IPv4 client-id for internal DHCP
- if we leave the client-id of sd_dhcp_client unset, it will
anyway generate a node-specific client-id (and may fail if
"/etc/machine-id" is invalid).
Anticipate that, and don't let the client-id unset. In case
we have no client-id from configuration or lease, just generate
the id ourself (using the same algorithm). The advantage is,
that we know it upfront and can store the client-id in the
NMDhcpClient instance. We no longer need to peel it out from
the lease later.
- to generate the IPv4 client-id, we need a valid MAC address. Also,
sd_dhcp_client needs a MAC address for dhcp_network_bind_raw_socket()
as well. Just require that a MAC address is always needed. Likewise,
we need a valid ifindex and ifname set.
- likewise for IPv6 and IPv4, cleanup detecting the arptype and
checking MAC address length. sd_dhcp_client_set_mac() is overly
strict at asserting input arguments, so we must validate them anyway.
- also, now that we always initialize the client-id when starting
the DHCP client, there is no need to retroactively extract it
again when we receive the first lease.
Diffstat (limited to 'libnm-core')
0 files changed, 0 insertions, 0 deletions