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 commit b626baa313)
(cherry picked from commit a842280dbe)
This commit is contained in:
Thomas Haller 2019-06-18 09:36:41 +02:00 committed by Beniamino Galvani
parent 4f489ac450
commit 36cdfe703f

View file

@ -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 (NM_IS_CONNECTIVITY (self), NULL);
g_return_val_if_fail (callback, NULL); g_return_val_if_fail (callback, NULL);
nm_assert (!platform || NM_IS_PLATFORM (platform));
priv = NM_CONNECTIVITY_GET_PRIVATE (self); priv = NM_CONNECTIVITY_GET_PRIVATE (self);
@ -898,6 +899,7 @@ nm_connectivity_check_start (NMConnectivity *self,
cb_data->concheck.ch_ifindex = ifindex; cb_data->concheck.ch_ifindex = ifindex;
if (platform) {
state = check_platform_config (self, state = check_platform_config (self,
platform, platform,
ifindex, ifindex,
@ -911,6 +913,7 @@ nm_connectivity_check_start (NMConnectivity *self,
cb_data->timeout_id = g_idle_add (_idle_cb, cb_data); cb_data->timeout_id = g_idle_add (_idle_cb, cb_data);
return cb_data; return cb_data;
} }
}
/* note that we pick up support for systemd-resolved right away when we need it. /* note that we pick up support for systemd-resolved right away when we need it.
* We don't need to remember the setting, because we can (cheaply) check anew * We don't need to remember the setting, because we can (cheaply) check anew