mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 22:10:09 +01:00
connectivity: make platform argument to nm_connectivity_check_start() optional
The platform is used to detect whether to skip the connectivity check right away. It should be an optional argument, so one could avoid this pre-check. (cherry picked from commitb626baa313) (cherry picked from commita842280dbe)
This commit is contained in:
parent
4f489ac450
commit
36cdfe703f
1 changed files with 15 additions and 12 deletions
|
|
@ -870,6 +870,7 @@ nm_connectivity_check_start (NMConnectivity *self,
|
|||
|
||||
g_return_val_if_fail (NM_IS_CONNECTIVITY (self), NULL);
|
||||
g_return_val_if_fail (callback, NULL);
|
||||
nm_assert (!platform || NM_IS_PLATFORM (platform));
|
||||
|
||||
priv = NM_CONNECTIVITY_GET_PRIVATE (self);
|
||||
|
||||
|
|
@ -898,18 +899,20 @@ nm_connectivity_check_start (NMConnectivity *self,
|
|||
|
||||
cb_data->concheck.ch_ifindex = ifindex;
|
||||
|
||||
state = check_platform_config (self,
|
||||
platform,
|
||||
ifindex,
|
||||
addr_family,
|
||||
&reason);
|
||||
nm_assert ((state == NM_CONNECTIVITY_UNKNOWN) == !reason);
|
||||
if (state != NM_CONNECTIVITY_UNKNOWN) {
|
||||
_LOG2D ("skip connectivity check due to %s", reason);
|
||||
cb_data->completed_state = state;
|
||||
cb_data->completed_reason = reason;
|
||||
cb_data->timeout_id = g_idle_add (_idle_cb, cb_data);
|
||||
return cb_data;
|
||||
if (platform) {
|
||||
state = check_platform_config (self,
|
||||
platform,
|
||||
ifindex,
|
||||
addr_family,
|
||||
&reason);
|
||||
nm_assert ((state == NM_CONNECTIVITY_UNKNOWN) == !reason);
|
||||
if (state != NM_CONNECTIVITY_UNKNOWN) {
|
||||
_LOG2D ("skip connectivity check due to %s", reason);
|
||||
cb_data->completed_state = state;
|
||||
cb_data->completed_reason = reason;
|
||||
cb_data->timeout_id = g_idle_add (_idle_cb, cb_data);
|
||||
return cb_data;
|
||||
}
|
||||
}
|
||||
|
||||
/* note that we pick up support for systemd-resolved right away when we need it.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue