dhcp: drop NMDhcpClientClass.get_duid() hook
Note that there are no callers of nm_dhcp_client_get_effective_client_id(), hence calling the setter had no effect. This is a bug, that we will fix later. But before fixing the bug, change how this works. Drop the get_duid() hook. It's only confusing and backward. We will keep the nm_dhcp_client_[gs]et_effective_client_id() functions. They will be used later.
This commit is contained in:
@@ -967,12 +967,6 @@ _dhcp_client_decline(NMDhcpClient *self,
|
||||
return klass->decline(self, l3cd, error_message, error);
|
||||
}
|
||||
|
||||
static GBytes *
|
||||
get_duid(NMDhcpClient *self)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ipv6_lladdr_timeout(gpointer user_data)
|
||||
{
|
||||
@@ -1318,11 +1312,6 @@ nm_dhcp_client_start(NMDhcpClient *self, GError **error)
|
||||
IS_IPv4 = NM_IS_IPv4(priv->config.addr_family);
|
||||
|
||||
if (!IS_IPv4) {
|
||||
if (!priv->config.v6.enforce_duid)
|
||||
own_client_id = NM_DHCP_CLIENT_GET_CLASS(self)->get_duid(self);
|
||||
|
||||
nm_dhcp_client_set_effective_client_id(self, own_client_id ?: priv->config.client_id);
|
||||
|
||||
addr = ipv6_lladdr_find(self);
|
||||
if (!addr) {
|
||||
_LOGD("waiting for IPv6LL address");
|
||||
@@ -1915,8 +1904,7 @@ nm_dhcp_client_class_init(NMDhcpClientClass *client_class)
|
||||
client_class->accept = _accept;
|
||||
client_class->decline = decline;
|
||||
|
||||
client_class->stop = stop;
|
||||
client_class->get_duid = get_duid;
|
||||
client_class->stop = stop;
|
||||
|
||||
obj_properties[PROP_CONFIG] =
|
||||
g_param_spec_pointer(NM_DHCP_CLIENT_CONFIG,
|
||||
|
@@ -215,17 +215,6 @@ typedef struct {
|
||||
gboolean (*ip6_start)(NMDhcpClient *self, const struct in6_addr *ll_addr, GError **error);
|
||||
|
||||
void (*stop)(NMDhcpClient *self, gboolean release);
|
||||
|
||||
/**
|
||||
* get_duid:
|
||||
* @self: the #NMDhcpClient
|
||||
*
|
||||
* Attempts to find an existing DHCPv6 DUID for this client in the DHCP
|
||||
* client's persistent configuration. Returned DUID should be the binary
|
||||
* representation of the DUID. If no DUID is found, %NULL should be
|
||||
* returned.
|
||||
*/
|
||||
GBytes *(*get_duid)(NMDhcpClient *self);
|
||||
} NMDhcpClientClass;
|
||||
|
||||
GType nm_dhcp_client_get_type(void);
|
||||
|
@@ -627,7 +627,7 @@ stop(NMDhcpClient *client, gboolean release)
|
||||
}
|
||||
}
|
||||
|
||||
static GBytes *
|
||||
_nm_unused static GBytes *
|
||||
get_duid(NMDhcpClient *client)
|
||||
{
|
||||
NMDhcpDhclient *self = NM_DHCP_DHCLIENT(client);
|
||||
@@ -724,7 +724,6 @@ nm_dhcp_dhclient_class_init(NMDhcpDhclientClass *dhclient_class)
|
||||
client_class->ip4_start = ip4_start;
|
||||
client_class->ip6_start = ip6_start;
|
||||
client_class->stop = stop;
|
||||
client_class->get_duid = get_duid;
|
||||
}
|
||||
|
||||
const NMDhcpClientFactory _nm_dhcp_client_factory_dhclient = {
|
||||
|
Reference in New Issue
Block a user