diff options
| author | Michael Biebl <biebl@debian.org> | 2022-02-14 19:23:28 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-02-14 19:23:28 +0100 |
| commit | 2f94dba7385fd0e0ef19a06eb4a2fcf6c43d7946 (patch) | |
| tree | e2222f5577115985dd52044d2991253403cdd952 /src/libnm-platform/nm-platform.c | |
| parent | 88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (diff) | |
New upstream version 1.35.91 upstream/1.35.91
Diffstat (limited to 'src/libnm-platform/nm-platform.c')
| -rw-r--r-- | src/libnm-platform/nm-platform.c | 523 |
1 files changed, 261 insertions, 262 deletions
diff --git a/src/libnm-platform/nm-platform.c b/src/libnm-platform/nm-platform.c index 5d4ec037..b95cd95e 100644 --- a/src/libnm-platform/nm-platform.c +++ b/src/libnm-platform/nm-platform.c @@ -115,9 +115,9 @@ nmp_link_address_get_as_bytes(const NMPLinkAddress *addr) #define NMLOG_COMMON(level, name, ...) \ char __prefix[32]; \ - const char * __p_prefix = _NMLOG_PREFIX_NAME; \ + const char *__p_prefix = _NMLOG_PREFIX_NAME; \ const NMPlatform *const __self = (self); \ - const char * __name = name; \ + const char *__name = name; \ \ if (__self && NM_PLATFORM_GET_PRIVATE(__self)->log_with_ptr) { \ g_snprintf(__prefix, sizeof(__prefix), "%s[%p]", _NMLOG_PREFIX_NAME, __self); \ @@ -187,9 +187,9 @@ typedef struct _NMPlatformPrivate { guint ip4_dev_route_blacklist_check_id; guint ip4_dev_route_blacklist_gc_timeout_id; - GHashTable * ip4_dev_route_blacklist_hash; + GHashTable *ip4_dev_route_blacklist_hash; NMDedupMultiIndex *multi_idx; - NMPCache * cache; + NMPCache *cache; } NMPlatformPrivate; G_DEFINE_TYPE(NMPlatform, nm_platform, G_TYPE_OBJECT) @@ -255,7 +255,7 @@ _nm_platform_signal_id_get(NMPlatformSignalIdType signal_type) #define _CHECK_SELF_NETNS(self, klass, netns, err_val) \ nm_auto_pop_netns NMPNetns *netns = NULL; \ - NMPlatformClass * klass; \ + NMPlatformClass *klass; \ do { \ g_return_val_if_fail(NM_IS_PLATFORM(self), err_val); \ klass = NM_PLATFORM_GET_CLASS(self); \ @@ -531,14 +531,14 @@ nm_platform_sysctl_set(NMPlatform *self, * independently of how /proc/sys/kernel/sysctl_writes_strict is configured. */ void -nm_platform_sysctl_set_async(NMPlatform * self, - const char * pathid, +nm_platform_sysctl_set_async(NMPlatform *self, + const char *pathid, int dirfd, - const char * path, - const char *const * values, + const char *path, + const char *const *values, NMPlatformAsyncCallback callback, gpointer data, - GCancellable * cancellable) + GCancellable *cancellable) { _CHECK_SELF_VOID(self, klass); @@ -717,7 +717,7 @@ nm_platform_sysctl_get_int_checked(NMPlatform *self, gint64 max, gint64 fallback) { - char * value = NULL; + char *value = NULL; gint32 ret; int errsv; @@ -821,7 +821,7 @@ int nm_platform_sysctl_ip_conf_get_rp_filter_ipv4(NMPlatform *self, const char *ifname, gboolean consider_all, - gboolean * out_due_to_all) + gboolean *out_due_to_all) { int val, val_all; @@ -899,11 +899,11 @@ _link_get_all_presort(gconstpointer p_a, gconstpointer p_b, gpointer sort_by_nam GPtrArray * nm_platform_link_get_all(NMPlatform *self, gboolean sort_by_name) { - gs_unref_ptrarray GPtrArray *links = NULL; - GPtrArray * result; - guint i, nresult; + gs_unref_ptrarray GPtrArray *links = NULL; + GPtrArray *result; + guint i, nresult; gs_unref_hashtable GHashTable *unseen = NULL; - const NMPlatformLink * item; + const NMPlatformLink *item; NMPLookup lookup; _CHECK_SELF(self, klass, NULL); @@ -1077,7 +1077,7 @@ struct _nm_platform_link_get_by_address_data { }; static gboolean -_nm_platform_link_get_by_address_match_link(const NMPObject * obj, +_nm_platform_link_get_by_address_match_link(const NMPObject *obj, struct _nm_platform_link_get_by_address_data *d) { return obj->link.l_address.len == d->len && !memcmp(obj->link.l_address.data, d->data, d->len); @@ -1093,12 +1093,12 @@ _nm_platform_link_get_by_address_match_link(const NMPObject * * address. **/ const NMPlatformLink * -nm_platform_link_get_by_address(NMPlatform * self, +nm_platform_link_get_by_address(NMPlatform *self, NMLinkType link_type, gconstpointer address, size_t length) { - const NMPObject * obj; + const NMPObject *obj; struct _nm_platform_link_get_by_address_data d = { .data = address, .len = length, @@ -1125,8 +1125,8 @@ nm_platform_link_get_by_address(NMPlatform * self, } static int -_link_add_check_existing(NMPlatform * self, - const char * name, +_link_add_check_existing(NMPlatform *self, + const char *name, NMLinkType type, const NMPlatformLink **out_link) { @@ -1174,11 +1174,11 @@ _link_add_check_existing(NMPlatform * self, * Returns: the negative nm-error on failure. */ int -nm_platform_link_add(NMPlatform * self, +nm_platform_link_add(NMPlatform *self, NMLinkType type, - const char * name, + const char *name, int parent, - const void * address, + const void *address, size_t address_len, guint32 mtu, gconstpointer extra_data, @@ -1439,13 +1439,13 @@ nm_platform_link_get_type_name(NMPlatform *self, int ifindex) } gboolean -nm_platform_link_get_udev_property(NMPlatform * self, +nm_platform_link_get_udev_property(NMPlatform *self, int ifindex, - const char * name, + const char *name, const char **out_value) { struct udev_device *udevice = NULL; - const char * uproperty; + const char *uproperty; udevice = nm_platform_link_get_udev_device(self, ifindex); if (!udevice) @@ -1717,7 +1717,7 @@ nm_platform_link_get_address(NMPlatform *self, int ifindex, size_t *length) * address. */ gboolean -nm_platform_link_get_permanent_address_ethtool(NMPlatform * self, +nm_platform_link_get_permanent_address_ethtool(NMPlatform *self, int ifindex, NMPLinkAddress *out_address) { @@ -1735,9 +1735,9 @@ nm_platform_link_get_permanent_address_ethtool(NMPlatform * self, } gboolean -nm_platform_link_get_permanent_address(NMPlatform * self, +nm_platform_link_get_permanent_address(NMPlatform *self, const NMPlatformLink *plink, - NMPLinkAddress * out_address) + NMPLinkAddress *out_address) { _CHECK_SELF(self, klass, FALSE); nm_assert(out_address); @@ -1804,13 +1804,13 @@ nm_platform_link_supports_sriov(NMPlatform *self, int ifindex) * always invoked, and asynchronously. */ void -nm_platform_link_set_sriov_params_async(NMPlatform * self, +nm_platform_link_set_sriov_params_async(NMPlatform *self, int ifindex, guint num_vfs, NMOptionBool autoprobe, NMPlatformAsyncCallback callback, gpointer callback_data, - GCancellable * cancellable) + GCancellable *cancellable) { _CHECK_SELF_VOID(self, klass); @@ -1845,7 +1845,7 @@ nm_platform_link_set_sriov_vfs(NMPlatform *self, int ifindex, const NMPlatformVF } gboolean -nm_platform_link_set_bridge_vlans(NMPlatform * self, +nm_platform_link_set_bridge_vlans(NMPlatform *self, int ifindex, gboolean on_master, const NMPlatformBridgeVlan *const *vlans) @@ -2038,9 +2038,9 @@ nm_platform_link_get_wake_on_lan(NMPlatform *self, int ifindex) gboolean nm_platform_link_get_driver_info(NMPlatform *self, int ifindex, - char ** out_driver_name, - char ** out_driver_version, - char ** out_fw_version) + char **out_driver_name, + char **out_driver_version, + char **out_fw_version) { _CHECK_SELF(self, klass, FALSE); @@ -2149,7 +2149,7 @@ nm_platform_link_can_assume(NMPlatform *self, int ifindex) * (but don't modify it). */ const NMPObject * -nm_platform_link_get_lnk(NMPlatform * self, +nm_platform_link_get_lnk(NMPlatform *self, int ifindex, NMLinkType link_type, const NMPlatformLink **out_link) @@ -2308,10 +2308,10 @@ static NM_UTILS_FLAGS2STR_DEFINE( NM_UTILS_FLAGS2STR(NM_PLATFORM_WIREGUARD_CHANGE_PEER_FLAG_REPLACE_ALLOWEDIPS, "remove-aips"), ); int -nm_platform_link_wireguard_change(NMPlatform * self, +nm_platform_link_wireguard_change(NMPlatform *self, int ifindex, - const NMPlatformLnkWireGuard * lnk_wireguard, - const NMPWireGuardPeer * peers, + const NMPlatformLnkWireGuard *lnk_wireguard, + const NMPWireGuardPeer *peers, const NMPlatformWireGuardChangePeerFlags *peer_flags, guint peers_len, NMPlatformWireGuardChangeFlags change_flags) @@ -2391,11 +2391,11 @@ nm_platform_link_wireguard_change(NMPlatform * self * Create a TUN or TAP interface. */ int -nm_platform_link_tun_add(NMPlatform * self, - const char * name, +nm_platform_link_tun_add(NMPlatform *self, + const char *name, const NMPlatformLnkTun *props, - const NMPlatformLink ** out_link, - int * out_fd) + const NMPlatformLink **out_link, + int *out_fd) { char b[255]; int r; @@ -2466,7 +2466,7 @@ link_set_option(NMPlatform *self, { nm_auto_close int dirfd = -1; char ifname_verified[IFNAMSIZ]; - const char * path; + const char *path; if (!category || !option) return FALSE; @@ -2487,7 +2487,7 @@ link_get_option(NMPlatform *self, int ifindex, const char *category, const char { nm_auto_close int dirfd = -1; char ifname_verified[IFNAMSIZ]; - const char * path; + const char *path; if (!category || !option) return NULL; @@ -2588,7 +2588,7 @@ nm_platform_sysctl_slave_get_option(NMPlatform *self, int ifindex, const char *o /*****************************************************************************/ gboolean -nm_platform_link_vlan_change(NMPlatform * self, +nm_platform_link_vlan_change(NMPlatform *self, int ifindex, _NMVlanFlags flags_mask, _NMVlanFlags flags_set, @@ -2680,7 +2680,7 @@ nm_platform_link_vlan_set_egress_map(NMPlatform *self, int ifindex, int from, in } static int -_infiniband_add_add_or_delete(NMPlatform * self, +_infiniband_add_add_or_delete(NMPlatform *self, int ifindex, int p_key, gboolean add, @@ -2727,7 +2727,7 @@ _infiniband_add_add_or_delete(NMPlatform * self, } int -nm_platform_link_infiniband_add(NMPlatform * self, +nm_platform_link_infiniband_add(NMPlatform *self, int parent, int p_key, const NMPlatformLink **out_link) @@ -2742,18 +2742,18 @@ nm_platform_link_infiniband_delete(NMPlatform *self, int parent, int p_key) } gboolean -nm_platform_link_infiniband_get_properties(NMPlatform * self, +nm_platform_link_infiniband_get_properties(NMPlatform *self, int ifindex, - int * out_parent, - int * out_p_key, + int *out_parent, + int *out_p_key, const char **out_mode) { nm_auto_close int dirfd = -1; char ifname_verified[IFNAMSIZ]; const NMPlatformLnkInfiniband *plnk; - const NMPlatformLink * plink; - char * contents; - const char * mode; + const NMPlatformLink *plink; + char *contents; + const char *mode; int p_key = 0; _CHECK_SELF(self, klass, FALSE); @@ -2968,11 +2968,11 @@ nm_platform_wifi_get_frequency(NMPlatform *self, int ifindex) } gboolean -nm_platform_wifi_get_station(NMPlatform * self, +nm_platform_wifi_get_station(NMPlatform *self, int ifindex, NMEtherAddr *out_bssid, - int * out_quality, - guint32 * out_rate) + int *out_quality, + guint32 *out_rate) { _CHECK_SELF(self, klass, FALSE); @@ -3143,11 +3143,12 @@ nm_platform_wpan_set_channel(NMPlatform *self, int ifindex, guint8 page, guint8 static const char * _to_string_dev(NMPlatform *self, int ifindex, char *buf, size_t size) { - g_assert(buf && size >= TO_STRING_DEV_BUF_SIZE); + nm_assert(buf); + nm_assert(size >= TO_STRING_DEV_BUF_SIZE); if (ifindex) { const char *name = ifindex > 0 && self ? nm_platform_link_get_name(self, ifindex) : NULL; - char * buf2; + char *buf2; strcpy(buf, " dev "); buf2 = buf + 5; @@ -3188,10 +3189,10 @@ _to_string_ifa_flags(guint32 ifa_flags, char *buf, gsize size) /*****************************************************************************/ gboolean -nm_platform_ethtool_set_wake_on_lan(NMPlatform * self, +nm_platform_ethtool_set_wake_on_lan(NMPlatform *self, int ifindex, _NMSettingWiredWakeOnLan wol, - const char * wol_password) + const char *wol_password) { _CHECK_SELF_NETNS(self, klass, netns, FALSE); @@ -3201,7 +3202,7 @@ nm_platform_ethtool_set_wake_on_lan(NMPlatform * self, } gboolean -nm_platform_ethtool_set_link_settings(NMPlatform * self, +nm_platform_ethtool_set_link_settings(NMPlatform *self, int ifindex, gboolean autoneg, guint32 speed, @@ -3215,10 +3216,10 @@ nm_platform_ethtool_set_link_settings(NMPlatform * self, } gboolean -nm_platform_ethtool_get_link_settings(NMPlatform * self, +nm_platform_ethtool_get_link_settings(NMPlatform *self, int ifindex, - gboolean * out_autoneg, - guint32 * out_speed, + gboolean *out_autoneg, + guint32 *out_speed, NMPlatformLinkDuplexType *out_duplex) { _CHECK_SELF_NETNS(self, klass, netns, FALSE); @@ -3242,7 +3243,7 @@ nm_platform_ethtool_get_link_features(NMPlatform *self, int ifindex) gboolean nm_platform_ethtool_set_features( - NMPlatform * self, + NMPlatform *self, int ifindex, const NMEthtoolFeatureStates *features, const NMOptionBool *requested /* indexed by NMEthtoolID - _NM_ETHTOOL_ID_FEATURE_FIRST */, @@ -3256,7 +3257,7 @@ nm_platform_ethtool_set_features( } gboolean -nm_platform_ethtool_get_link_coalesce(NMPlatform * self, +nm_platform_ethtool_get_link_coalesce(NMPlatform *self, int ifindex, NMEthtoolCoalesceState *coalesce) { @@ -3269,7 +3270,7 @@ nm_platform_ethtool_get_link_coalesce(NMPlatform * self, } gboolean -nm_platform_ethtool_set_coalesce(NMPlatform * self, +nm_platform_ethtool_set_coalesce(NMPlatform *self, int ifindex, const NMEthtoolCoalesceState *coalesce) { @@ -3380,8 +3381,8 @@ nm_platform_lookup_predicate_routes_main_skip_rtprot_kernel(const NMPObject *obj * Returns: the result of the lookup. */ GPtrArray * -nm_platform_lookup_clone(NMPlatform * self, - const NMPLookup * lookup, +nm_platform_lookup_clone(NMPlatform *self, + const NMPLookup *lookup, NMPObjectPredicateFunc predicate, gpointer user_data) { @@ -3511,7 +3512,7 @@ nm_platform_ip4_address_add(NMPlatform *self, } gboolean -nm_platform_ip6_address_add(NMPlatform * self, +nm_platform_ip6_address_add(NMPlatform *self, int ifindex, struct in6_addr address, guint8 plen, @@ -3630,7 +3631,7 @@ nm_platform_ip6_address_get(NMPlatform *self, int ifindex, const struct in6_addr static gboolean _addr_array_clean_expired(int addr_family, int ifindex, - GPtrArray * array, + GPtrArray *array, guint32 now, GHashTable **idx) { @@ -3748,7 +3749,7 @@ ip4_addr_subnets_build_index(const GPtrArray *addresses, for (i = 0; i < addresses->len; i++) { const NMPlatformIP4Address *address; gpointer p_address; - GPtrArray * addr_list; + GPtrArray *addr_list; guint32 net; int position; gpointer p; @@ -3805,16 +3806,16 @@ ip4_addr_subnets_build_index(const GPtrArray *addresses, * Returns: %TRUE if the address is secondary, %FALSE otherwise */ static gboolean -ip4_addr_subnets_is_secondary(const NMPObject * address, - GHashTable * subnets, - const GPtrArray * addresses, +ip4_addr_subnets_is_secondary(const NMPObject *address, + GHashTable *subnets, + const GPtrArray *addresses, const GPtrArray **out_addr_list) { const NMPlatformIP4Address *a; - const GPtrArray * addr_list; + const GPtrArray *addr_list; gconstpointer p; guint32 net; - const NMPObject ** o; + const NMPObject **o; a = NMP_OBJECT_CAST_IP4_ADDRESS(address); @@ -3902,14 +3903,14 @@ gboolean nm_platform_ip_address_sync(NMPlatform *self, int addr_family, int ifindex, - GPtrArray * known_addresses, - GPtrArray * addresses_prune) + GPtrArray *known_addresses, + GPtrArray *addresses_prune) { - const gint32 now = nm_utils_get_monotonic_timestamp_sec(); - const int IS_IPv4 = NM_IS_IPv4(addr_family); + const gint32 now = nm_utils_get_monotonic_timestamp_sec(); + const int IS_IPv4 = NM_IS_IPv4(addr_family); gs_unref_hashtable GHashTable *known_addresses_idx = NULL; - GPtrArray * plat_addresses; - GHashTable * known_subnets = NULL; + GPtrArray *plat_addresses; + GHashTable *known_subnets = NULL; guint i_plat; guint i_know; guint i; @@ -3947,9 +3948,9 @@ nm_platform_ip_address_sync(NMPlatform *self, plat_subnets = ip4_addr_subnets_build_index(plat_addresses, TRUE, TRUE); for (i = 0; i < plat_addresses->len; i++) { - const NMPObject * plat_obj; + const NMPObject *plat_obj; const NMPlatformIP4Address *plat_address; - const GPtrArray * addr_list; + const GPtrArray *addr_list; plat_obj = plat_addresses->pdata[i]; if (!plat_obj) { @@ -4044,8 +4045,8 @@ nm_platform_ip_address_sync(NMPlatform *self, * * Note that we mark handled addresses by setting it to %NULL in @plat_addresses array. */ for (i_plat = 0; i_plat < plat_addresses->len; i_plat++) { - const NMPObject * plat_obj = plat_addresses->pdata[i_plat]; - const NMPObject * know_obj; + const NMPObject *plat_obj = plat_addresses->pdata[i_plat]; + const NMPObject *know_obj; const NMPlatformIP6Address *plat_addr = NMP_OBJECT_CAST_IP6_ADDRESS(plat_obj); if (known_addresses_idx) { @@ -4141,7 +4142,7 @@ next_plat:; */ for (i_know = 0; i_know < known_addresses->len; i_know++) { const NMPlatformIPXAddress *known_address; - const NMPObject * o; + const NMPObject *o; guint32 lifetime; guint32 preferred; @@ -4211,7 +4212,7 @@ nm_platform_ip_address_flush(NMPlatform *self, int addr_family, int ifindex) static gboolean _err_inval_due_to_ipv6_tentative_pref_src(NMPlatform *self, const NMPObject *obj) { - const NMPlatformIP6Route * r; + const NMPlatformIP6Route *r; const NMPlatformIP6Address *a; nm_assert(NM_IS_PLATFORM(self)); @@ -4253,8 +4254,8 @@ nm_platform_ip_address_get_prune_list(NMPlatform *self, const int IS_IPv4 = NM_IS_IPv4(addr_family); const NMDedupMultiHeadEntry *head_entry; NMPLookup lookup; - GPtrArray * result; - CList * iter; + GPtrArray *result; + CList *iter; nmp_lookup_init_object(&lookup, NMP_OBJECT_TYPE_IP_ADDRESS(NM_IS_IPv4(addr_family)), ifindex); @@ -4285,20 +4286,20 @@ nm_platform_ip_address_get_prune_list(NMPlatform *self, } GPtrArray * -nm_platform_ip_route_get_prune_list(NMPlatform * self, +nm_platform_ip_route_get_prune_list(NMPlatform *self, int addr_family, int ifindex, NMIPRouteTableSyncMode route_table_sync) { NMPLookup lookup; - GPtrArray * routes_prune; + GPtrArray *routes_prune; const NMDedupMultiHeadEntry *head_entry; - CList * iter; + CList *iter; NMPlatformIP4Route rt_local4; NMPlatformIP6Route rt_local6; NMPlatformIP6Route rt_mcast6; - const NMPlatformLink * pllink; - const NMPlatformLnkVrf * lnk_vrf; + const NMPlatformLink *pllink; + const NMPlatformLnkVrf *lnk_vrf; guint32 local_table; nm_assert(NM_IS_PLATFORM(self)); @@ -4326,7 +4327,7 @@ nm_platform_ip_route_get_prune_list(NMPlatform * self, routes_prune = g_ptr_array_new_full(head_entry->len, (GDestroyNotify) nm_dedup_multi_obj_unref); c_list_for_each (iter, &head_entry->lst_entries_head) { - const NMPObject * obj = c_list_entry(iter, NMDedupMultiEntry, lst_entries)->obj; + const NMPObject *obj = c_list_entry(iter, NMDedupMultiEntry, lst_entries)->obj; const NMPlatformIPXRoute *rt = NMP_OBJECT_CAST_IPX_ROUTE(obj); switch (route_table_sync) { @@ -4493,15 +4494,15 @@ gboolean nm_platform_ip_route_sync(NMPlatform *self, int addr_family, int ifindex, - GPtrArray * routes, - GPtrArray * routes_prune, + GPtrArray *routes, + GPtrArray *routes_prune, GPtrArray **out_temporary_not_available) { - const int IS_IPv4 = NM_IS_IPv4(addr_family); - const NMPlatformVTableRoute *vt; + const int IS_IPv4 = NM_IS_IPv4(addr_family); + const NMPlatformVTableRoute *vt; gs_unref_hashtable GHashTable *routes_idx = NULL; - const NMPObject * conf_o; - const NMDedupMultiEntry * plat_entry; + const NMPObject *conf_o; + const NMDedupMultiEntry *plat_entry; guint i; int i_type; gboolean success = TRUE; @@ -4520,12 +4521,6 @@ nm_platform_ip_route_sync(NMPlatform *self, conf_o = routes->pdata[i]; - if (NMP_OBJECT_CAST_IP_ROUTE(conf_o)->is_external) { - /* This route is added externally. We don't have our own agenda to - * add it, so skip. */ - continue; - } - /* User space cannot add IPv6 routes with metric 0. However, kernel can, and we might track such * routes in @route as they are present external. As we already skipped external routes above, * we don't expect a user's choice to add such a route (it won't work anyway). */ @@ -4721,24 +4716,6 @@ sync_route_add: } if (routes_prune) { - if (routes) { - for (i = 0; i < routes->len; i++) { - conf_o = routes->pdata[i]; - - if (NMP_OBJECT_CAST_IP_ROUTE(conf_o)->is_external) { - /* this is only to catch the case where an external route is - * both in @routes and @routes_prune list. In that case, - * @routes should win and we should not remove the address. */ - if (!routes_idx) { - routes_idx = g_hash_table_new((GHashFunc) nmp_object_id_hash, - (GEqualFunc) nmp_object_id_equal); - } - g_hash_table_add(routes_idx, (gpointer) conf_o); - continue; - } - } - } - for (i = 0; i < routes_prune->len; i++) { const NMPObject *prune_o; @@ -4958,11 +4935,11 @@ nm_platform_object_delete(NMPlatform *self, const NMPObject *obj) /*****************************************************************************/ int -nm_platform_ip_route_get(NMPlatform * self, +nm_platform_ip_route_get(NMPlatform *self, int addr_family, gconstpointer address /* in_addr_t or struct in6_addr */, int oif_ifindex, - NMPObject ** out_route) + NMPObject **out_route) { nm_auto_nmpobj NMPObject *route = NULL; int result; @@ -5027,11 +5004,11 @@ _ip4_dev_route_blacklist_timeout_ms_marked(gint64 timeout_msec) static gboolean _ip4_dev_route_blacklist_check_cb(gpointer user_data) { - NMPlatform * self = user_data; + NMPlatform *self = user_data; NMPlatformPrivate *priv = NM_PLATFORM_GET_PRIVATE(self); GHashTableIter iter; - const NMPObject * p_obj; - gint64 * p_timeout_ms; + const NMPObject *p_obj; + gint64 *p_timeout_ms; gint64 now_ms; priv->ip4_dev_route_blacklist_check_id = 0; @@ -5081,8 +5058,8 @@ static void _ip4_dev_route_blacklist_notify_route(NMPlatform *self, const NMPObject *obj) { NMPlatformPrivate *priv; - const NMPObject * p_obj; - gint64 * p_timeout_ms; + const NMPObject *p_obj; + gint64 *p_timeout_ms; gint64 now_ms; nm_assert(NM_IS_PLATFORM(self)); @@ -5120,11 +5097,11 @@ _ip4_dev_route_blacklist_notify_route(NMPlatform *self, const NMPObject *obj) static gboolean _ip4_dev_route_blacklist_gc_timeout_handle(gpointer user_data) { - NMPlatform * self = user_data; + NMPlatform *self = user_data; NMPlatformPrivate *priv = NM_PLATFORM_GET_PRIVATE(self); GHashTableIter iter; - const NMPObject * p_obj; - gint64 * p_timeout_ms; + const NMPObject *p_obj; + gint64 *p_timeout_ms; gint64 now_ms; nm_assert(priv->ip4_dev_route_blacklist_gc_timeout_id); @@ -5193,15 +5170,15 @@ _ip4_dev_route_blacklist_schedule(NMPlatform *self) void nm_platform_ip4_dev_route_blacklist_set(NMPlatform *self, int ifindex, - GPtrArray * ip4_dev_route_blacklist) + GPtrArray *ip4_dev_route_blacklist) { NMPlatformPrivate *priv; GHashTableIter iter; - const NMPObject * p_obj; + const NMPObject *p_obj; guint i; gint64 timeout_msec; gint64 timeout_msec_val; - gint64 * p_timeout_ms; + gint64 *p_timeout_ms; gboolean needs_check = FALSE; nm_assert(NM_IS_PLATFORM(self)); @@ -5275,7 +5252,7 @@ nm_platform_ip4_dev_route_blacklist_set(NMPlatform *self, /*****************************************************************************/ int -nm_platform_routing_rule_add(NMPlatform * self, +nm_platform_routing_rule_add(NMPlatform *self, NMPNlmFlags flags, const NMPlatformRoutingRule *routing_rule) { @@ -5355,8 +5332,8 @@ nm_platform_tfilter_delete(NMPlatform *self, int ifindex, guint32 parent, gboole gboolean nm_platform_tc_sync(NMPlatform *self, int ifindex, - GPtrArray * known_qdiscs, - GPtrArray * known_tfilters) + GPtrArray *known_qdiscs, + GPtrArray *known_tfilters) { guint i; gboolean success = TRUE; @@ -5397,10 +5374,10 @@ nm_platform_tc_sync(NMPlatform *self, /*****************************************************************************/ const char * -nm_platform_vlan_qos_mapping_to_string(const char * name, +nm_platform_vlan_qos_mapping_to_string(const char *name, const NMVlanQosMapping *map, gsize n_map, - char * buf, + char *buf, gsize len) { gsize i; @@ -5448,7 +5425,7 @@ _lifetime_summary_to_string(gint32 now, guint32 timestamp, guint32 preferred, guint32 lifetime, - char * buf, + char *buf, size_t buf_size) { g_snprintf(buf, @@ -5478,7 +5455,7 @@ nm_platform_link_to_string(const NMPlatformLink *link, char *buf, gsize len) char parent[20]; char str_flags[1 + NM_PLATFORM_LINK_FLAGS2STR_MAX_LEN + 1]; char str_highlighted_flags[50]; - char * s; + char *s; gsize l; char str_addrmode[30]; char str_address[_NM_UTILS_HWADDR_LEN_MAX * 3]; @@ -6109,7 +6086,7 @@ nm_platform_lnk_vxlan_to_string(const NMPlatformLnkVxlan *lnk, char *buf, gsize const char * nm_platform_wireguard_peer_to_string(const NMPWireGuardPeer *peer, char *buf, gsize len) { - char * buf0 = buf; + char *buf0 = buf; gs_free char *public_key_b64 = NULL; char s_sockaddr[NM_UTILS_INET_ADDRSTRLEN + 100]; char s_endpoint[20 + sizeof(s_sockaddr)]; @@ -6214,7 +6191,7 @@ nm_platform_ip4_address_to_string(const NMPlatformIP4Address *address, char *buf char str_dev[TO_STRING_DEV_BUF_SIZE]; char str_label[32]; char str_lft[30], str_pref[30], str_time[50], s_source[50]; - char * str_peer = NULL; + char *str_peer = NULL; const char *str_lft_p, *str_pref_p, *str_time_p; gint32 now = nm_utils_get_monotonic_timestamp_sec(); in_addr_t broadcast_address; @@ -6273,9 +6250,9 @@ nm_platform_ip4_address_to_string(const NMPlatformIP4Address *address, char *buf "%s" /* flags */ "%s" /* label */ " src %s" - "%s" /* external */ "%s" /* a_acd_not_ready */ "%s" /* a_assume_config_once */ + "%s" /* a_force_commit */ "", s_address, address->plen, @@ -6293,9 +6270,9 @@ nm_platform_ip4_address_to_string(const NMPlatformIP4Address *address, char *buf _to_string_ifa_flags(address->n_ifa_flags, s_flags, sizeof(s_flags)), str_label, nmp_utils_ip_config_source_to_string(address->addr_source, s_source, sizeof(s_source)), - address->external ? " ext" : "", address->a_acd_not_ready ? " ip4acd-not-ready" : "", - address->a_assume_config_once ? " assume-config-once" : ""); + address->a_assume_config_once ? " assume-config-once" : "", + address->a_force_commit ? " force-commit" : ""); g_free(str_peer); return buf; } @@ -6374,7 +6351,7 @@ nm_platform_ip6_address_to_string(const NMPlatformIP6Address *address, char *buf char s_peer[INET6_ADDRSTRLEN]; char str_lft[30], str_pref[30], str_time[50], s_source[50]; char str_dev[TO_STRING_DEV_BUF_SIZE]; - char * str_peer = NULL; + char *str_peer = NULL; const char *str_lft_p, *str_pref_p, *str_time_p; gint32 now = nm_utils_get_monotonic_timestamp_sec(); @@ -6415,8 +6392,8 @@ nm_platform_ip6_address_to_string(const NMPlatformIP6Address *address, char *buf buf, len, "%s/%d lft %s pref %s%s%s%s%s src %s" - "%s" /* external */ "%s" /* a_assume_config_once */ + "%s" /* a_force_commit */ "", s_address, address->plen, @@ -6427,8 +6404,8 @@ nm_platform_ip6_address_to_string(const NMPlatformIP6Address *address, char *buf str_dev, _to_string_ifa_flags(address->n_ifa_flags, s_flags, sizeof(s_flags)), nmp_utils_ip_config_source_to_string(address->addr_source, s_source, sizeof(s_source)), - address->external ? " external" : "", - address->a_assume_config_once ? " assume-config-once" : ""); + address->a_assume_config_once ? " assume-config-once" : "", + address->a_force_commit ? " force-commit" : ""); g_free(str_peer); return buf; } @@ -6482,12 +6459,19 @@ _rtm_flags_to_string_full(char *buf, gsize buf_size, unsigned rtm_flags) const char * nm_platform_ip4_route_to_string(const NMPlatformIP4Route *route, char *buf, gsize len) { - char s_network[INET_ADDRSTRLEN], s_gateway[INET_ADDRSTRLEN]; + char s_network[INET_ADDRSTRLEN]; + char s_gateway[INET_ADDRSTRLEN]; char s_pref_src[INET_ADDRSTRLEN]; char str_dev[TO_STRING_DEV_BUF_SIZE]; char str_table[30]; - char str_scope[30], s_source[50]; - char str_tos[32], str_window[32], str_cwnd[32], str_initcwnd[32], str_initrwnd[32], str_mtu[32]; + char str_scope[30]; + char s_source[50]; + char str_tos[32]; + char str_window[32]; + char str_cwnd[32]; + char str_initcwnd[32]; + char str_initrwnd[32]; + char str_mtu[32]; char str_rtm_flags[_RTM_FLAGS_TO_STRING_MAXLEN]; char str_type[30]; char str_metric[30]; @@ -6496,7 +6480,11 @@ nm_platform_ip4_route_to_string(const NMPlatformIP4Route *route, char *buf, gsiz return buf; inet_ntop(AF_INET, &route->network, s_network, sizeof(s_network)); - inet_ntop(AF_INET, &route->gateway, s_gateway, sizeof(s_gateway)); + + if (route->gateway == 0) + s_gateway[0] = '\0'; + else + inet_ntop(AF_INET, &route->gateway, s_gateway, sizeof(s_gateway)); _to_string_dev(NULL, route->ifindex, str_dev, sizeof(str_dev)); @@ -6506,21 +6494,22 @@ nm_platform_ip4_route_to_string(const NMPlatformIP4Route *route, char *buf, gsiz "type %s " /* type */ "%s" /* table */ "%s/%d" - " via %s" + "%s%s" /* gateway */ "%s" " metric %s" - " mss %" G_GUINT32_FORMAT " rt-src %s" /* protocol */ - "%s" /* rtm_flags */ - "%s%s" /* scope */ - "%s%s" /* pref-src */ - "%s" /* tos */ - "%s" /* window */ - "%s" /* cwnd */ - "%s" /* initcwnd */ - "%s" /* initrwnd */ - "%s" /* mtu */ - "%s" /* is_external */ - "%s" /* r_assume_config_once */ + " mss %" G_GUINT32_FORMAT /* mss */ + " rt-src %s" /* protocol */ + "%s" /* rtm_flags */ + "%s%s" /* scope */ + "%s%s" /* pref-src */ + "%s" /* tos */ + "%s" /* window */ + "%s" /* cwnd */ + "%s" /* initcwnd */ + "%s" /* initrwnd */ + "%s" /* mtu */ + "%s" /* r_assume_config_once */ + "%s" /* r_force_commit */ "", nm_net_aux_rtnl_rtntype_n2a_maybe_buf(nm_platform_route_type_uncoerce(route->type_coerced), str_type), @@ -6533,6 +6522,7 @@ nm_platform_ip4_route_to_string(const NMPlatformIP4Route *route, char *buf, gsiz : ""), s_network, route->plen, + s_gateway[0] ? " via " : "", s_gateway, str_dev, route->metric_any @@ -6577,8 +6567,8 @@ nm_platform_ip4_route_to_string(const NMPlatformIP4Route *route, char *buf, gsiz route->lock_mtu ? "lock " : "", route->mtu) : "", - route->is_external ? " is-external" : "", - route->r_assume_config_once ? " assume-config-once" : ""); + route->r_assume_config_once ? " assume-config-once" : "", + route->r_force_commit ? " force-commit" : ""); return buf; } @@ -6620,7 +6610,11 @@ nm_platform_ip6_route_to_string(const NMPlatformIP6Route *route, char *buf, gsiz return buf; inet_ntop(AF_INET6, &route->network, s_network, sizeof(s_network)); - inet_ntop(AF_INET6, &route->gateway, s_gateway, sizeof(s_gateway)); + + if (IN6_IS_ADDR_UNSPECIFIED(&route->gateway)) + s_gateway[0] = '\0'; + else + inet_ntop(AF_INET6, &route->gateway, s_gateway, sizeof(s_gateway)); if (IN6_IS_ADDR_UNSPECIFIED(&route->pref_src)) s_pref_src[0] = 0; @@ -6635,21 +6629,22 @@ nm_platform_ip6_route_to_string(const NMPlatformIP6Route *route, char *buf, gsiz "type %s " /* type */ "%s" /* table */ "%s/%d" - " via %s" + "%s%s" /* gateway */ "%s" " metric %s" - " mss %" G_GUINT32_FORMAT " rt-src %s" /* protocol */ - "%s" /* source */ - "%s" /* rtm_flags */ - "%s%s" /* pref-src */ - "%s" /* window */ - "%s" /* cwnd */ - "%s" /* initcwnd */ - "%s" /* initrwnd */ - "%s" /* mtu */ - "%s" /* pref */ - "%s" /* is_external */ - "%s" /* r_assume_config_once */ + " mss %" G_GUINT32_FORMAT /* mss */ + " rt-src %s" /* protocol */ + "%s" /* source */ + "%s" /* rtm_flags */ + "%s%s" /* pref-src */ + "%s" /* window */ + "%s" /* cwnd */ + "%s" /* initcwnd */ + "%s" /* initrwnd */ + "%s" /* mtu */ + "%s" /* pref */ + "%s" /* r_assume_config_once */ + "%s" /* r_force_commit */ "", nm_net_aux_rtnl_rtntype_n2a_maybe_buf(nm_platform_route_type_uncoerce(route->type_coerced), str_type), @@ -6662,6 +6657,7 @@ nm_platform_ip6_route_to_string(const NMPlatformIP6Route *route, char *buf, gsiz : ""), s_network, route->plen, + s_gateway[0] ? " via " : "", s_gateway, str_dev, route->metric_any @@ -6710,15 +6706,15 @@ nm_platform_ip6_route_to_string(const NMPlatformIP6Route *route, char *buf, gsiz " pref %s", nm_icmpv6_router_pref_to_string(route->rt_pref, str_pref2, sizeof(str_pref2))) : "", - route->is_external ? " is-external" : "", - route->r_assume_config_once ? " assume-config-once" : ""); + route->r_assume_config_once ? " assume-config-once" : "", + route->r_force_commit ? " force-commit" : ""); return buf; } static void -_routing_rule_addr_to_string(char ** buf, - gsize * len, +_routing_rule_addr_to_string(char **buf, + gsize *len, int addr_family, const NMIPAddr *addr, guint8 plen, @@ -6752,10 +6748,10 @@ _routing_rule_addr_to_string(char ** buf, } static void -_routing_rule_port_range_to_string(char ** buf, - gsize * len, +_routing_rule_port_range_to_string(char **buf, + gsize *len, const NMFibRulePortRange *port_range, - const char * name) + const char *name) { if (port_range->start == 0 && port_range->end == 0) nm_strbuf_append_str(buf, len, ""); @@ -7179,11 +7175,11 @@ nm_platform_tfilter_cmp(const NMPlatformTfilter *a, const NMPlatformTfilter *b) const char * nm_platform_vf_to_string(const NMPlatformVF *vf, char *buf, gsize len) { - char str_mac[128], mac[128]; - char str_spoof_check[64]; - char str_trust[64]; - char str_min_tx_rate[64]; - char str_max_tx_rate[64]; + char str_mac[128], mac[128]; + char str_spoof_check[64]; + char str_trust[64]; + char str_min_tx_rate[64]; + char str_max_tx_rate[64]; nm_auto_free_gstring GString *gstr_vlans = NULL; guint i; @@ -7845,10 +7841,10 @@ nm_platform_ip4_address_hash_update(const NMPlatformIP4Address *obj, NMHashState obj->address, obj->peer_address, NM_HASH_COMBINE_BOOLS(guint8, - obj->external, obj->use_ip4_broadcast_address, obj->a_acd_not_ready, - obj->a_assume_config_once)); + obj->a_assume_config_once, + obj->a_force_commit)); nm_hash_update_strarr(h, obj->label); } @@ -7869,26 +7865,27 @@ nm_platform_ip4_address_cmp(const NMPlatformIP4Address *a, const NMPlatformIP4Ad NM_CMP_FIELD(a, b, preferred); NM_CMP_FIELD(a, b, n_ifa_flags); NM_CMP_FIELD_STR(a, b, label); - NM_CMP_FIELD_UNSAFE(a, b, external); NM_CMP_FIELD_UNSAFE(a, b, a_acd_not_ready); NM_CMP_FIELD_UNSAFE(a, b, a_assume_config_once); + NM_CMP_FIELD_UNSAFE(a, b, a_force_commit); return 0; } void nm_platform_ip6_address_hash_update(const NMPlatformIP6Address *obj, NMHashState *h) { - nm_hash_update_vals(h, - obj->ifindex, - obj->addr_source, - obj->timestamp, - obj->lifetime, - obj->preferred, - obj->n_ifa_flags, - obj->plen, - obj->address, - obj->peer_address, - NM_HASH_COMBINE_BOOLS(guint8, obj->external, obj->a_assume_config_once)); + nm_hash_update_vals( + h, + obj->ifindex, + obj->addr_source, + obj->timestamp, + obj->lifetime, + obj->preferred, + obj->n_ifa_flags, + obj->plen, + obj->address, + obj->peer_address, + NM_HASH_COMBINE_BOOLS(guint8, obj->a_assume_config_once, obj->a_force_commit)); } int @@ -7908,15 +7905,15 @@ nm_platform_ip6_address_cmp(const NMPlatformIP6Address *a, const NMPlatformIP6Ad NM_CMP_FIELD(a, b, lifetime); NM_CMP_FIELD(a, b, preferred); NM_CMP_FIELD(a, b, n_ifa_flags); - NM_CMP_FIELD_UNSAFE(a, b, external); NM_CMP_FIELD_UNSAFE(a, b, a_assume_config_once); + NM_CMP_FIELD_UNSAFE(a, b, a_force_commit); return 0; } void nm_platform_ip4_route_hash_update(const NMPlatformIP4Route *obj, NMPlatformIPRouteCmpType cmp_type, - NMHashState * h) + NMHashState *h) { switch (cmp_type) { case NM_PLATFORM_IP_ROUTE_CMP_TYPE_WEAK_ID: @@ -8018,8 +8015,8 @@ nm_platform_ip4_route_hash_update(const NMPlatformIP4Route *obj, obj->lock_initcwnd, obj->lock_initrwnd, obj->lock_mtu, - obj->is_external, - obj->r_assume_config_once)); + obj->r_assume_config_once, + obj->r_force_commit)); break; } } @@ -8110,8 +8107,8 @@ nm_platform_ip4_route_cmp(const NMPlatformIP4Route *a, NM_CMP_FIELD(a, b, initrwnd); NM_CMP_FIELD(a, b, mtu); if (cmp_type == NM_PLATFORM_IP_ROUTE_CMP_TYPE_FULL) { - NM_CMP_FIELD_UNSAFE(a, b, is_external); NM_CMP_FIELD_UNSAFE(a, b, r_assume_config_once); + NM_CMP_FIELD_UNSAFE(a, b, r_force_commit); } break; } @@ -8121,7 +8118,7 @@ nm_platform_ip4_route_cmp(const NMPlatformIP4Route *a, void nm_platform_ip6_route_hash_update(const NMPlatformIP6Route *obj, NMPlatformIPRouteCmpType cmp_type, - NMHashState * h) + NMHashState *h) { struct in6_addr a1, a2; @@ -8205,8 +8202,8 @@ nm_platform_ip6_route_hash_update(const NMPlatformIP6Route *obj, obj->lock_initcwnd, obj->lock_initrwnd, obj->lock_mtu, - obj->is_external, - obj->r_assume_config_once), + obj->r_assume_config_once, + obj->r_force_commit), obj->window, obj->cwnd, obj->initcwnd, @@ -8290,8 +8287,8 @@ nm_platform_ip6_route_cmp(const NMPlatformIP6Route *a, else NM_CMP_FIELD(a, b, rt_pref); if (cmp_type == NM_PLATFORM_IP_ROUTE_CMP_TYPE_FULL) { - NM_CMP_FIELD_UNSAFE(a, b, is_external); NM_CMP_FIELD_UNSAFE(a, b, r_assume_config_once); + NM_CMP_FIELD_UNSAFE(a, b, r_force_commit); } break; } @@ -8308,7 +8305,7 @@ nm_platform_ip6_route_cmp(const NMPlatformIP6Route *a, void nm_platform_routing_rule_hash_update(const NMPlatformRoutingRule *obj, NMPlatformRoutingRuleCmpType cmp_type, - NMHashState * h) + NMHashState *h) { gboolean cmp_full = TRUE; gsize addr_size; @@ -8551,9 +8548,9 @@ nm_platform_ip4_address_addr_to_hash(NMPlatform *self, int ifindex) { const NMDedupMultiHeadEntry *head_entry; NMDedupMultiIter iter; - const NMPObject * obj; + const NMPObject *obj; NMPLookup lookup; - GHashTable * hash; + GHashTable *hash; g_return_val_if_fail(NM_IS_PLATFORM(self), NULL); g_return_val_if_fail(ifindex > 0, NULL); @@ -8583,7 +8580,8 @@ nm_platform_ip4_address_generate_device_route(const NMPlatformIP4Address *addr, int ifindex, guint32 route_table, guint32 route_metric, - NMPlatformIP4Route * dst) + gboolean force_commit, + NMPlatformIP4Route *dst) { in_addr_t network_4; @@ -8614,14 +8612,15 @@ nm_platform_ip4_address_generate_device_route(const NMPlatformIP4Address *addr, } *dst = (NMPlatformIP4Route){ - .ifindex = ifindex, - .rt_source = NM_IP_CONFIG_SOURCE_KERNEL, - .network = network_4, - .plen = addr->plen, - .pref_src = addr->address, - .table_coerced = nm_platform_route_table_coerce(route_table), - .metric = route_metric, - .scope_inv = nm_platform_route_scope_inv(NM_RT_SCOPE_LINK), + .ifindex = ifindex, + .rt_source = NM_IP_CONFIG_SOURCE_KERNEL, + .network = network_4, + .plen = addr->plen, + .pref_src = addr->address, + .table_coerced = nm_platform_route_table_coerce(route_table), + .metric = route_metric, + .scope_inv = nm_platform_route_scope_inv(NM_RT_SCOPE_LINK), + .r_force_commit = force_commit, }; nm_platform_ip_route_normalize(AF_INET, (NMPlatformIPRoute *) dst); @@ -8645,10 +8644,10 @@ nm_platform_signal_change_type_to_string(NMPlatformSignalChangeType change_type) } static void -log_link(NMPlatform * self, +log_link(NMPlatform *self, NMPObjectType obj_type, int ifindex, - NMPlatformLink * device, + NMPlatformLink *device, NMPlatformSignalChangeType change_type, gpointer user_data) { @@ -8658,10 +8657,10 @@ log_link(NMPlatform * self, } static void -log_ip4_address(NMPlatform * self, +log_ip4_address(NMPlatform *self, NMPObjectType obj_type, int ifindex, - NMPlatformIP4Address * address, + NMPlatformIP4Address *address, NMPlatformSignalChangeType change_type, gpointer user_data) { @@ -8671,10 +8670,10 @@ log_ip4_address(NMPlatform * self, } static void -log_ip6_address(NMPlatform * self, +log_ip6_address(NMPlatform *self, NMPObjectType obj_type, int ifindex, - NMPlatformIP6Address * address, + NMPlatformIP6Address *address, NMPlatformSignalChangeType change_type, gpointer user_data) { @@ -8684,10 +8683,10 @@ log_ip6_address(NMPlatform * self, } static void -log_ip4_route(NMPlatform * self, +log_ip4_route(NMPlatform *self, NMPObjectType obj_type, int ifindex, - NMPlatformIP4Route * route, + NMPlatformIP4Route *route, NMPlatformSignalChangeType change_type, gpointer user_data) { @@ -8697,10 +8696,10 @@ log_ip4_route(NMPlatform * self, } static void -log_ip6_route(NMPlatform * self, +log_ip6_route(NMPlatform *self, NMPObjectType obj_type, int ifindex, - NMPlatformIP6Route * route, + NMPlatformIP6Route *route, NMPlatformSignalChangeType change_type, gpointer user_data) { @@ -8710,10 +8709,10 @@ log_ip6_route(NMPlatform * self, } static void -log_routing_rule(NMPlatform * self, +log_routing_rule(NMPlatform *self, NMPObjectType obj_type, int ifindex, - NMPlatformRoutingRule * routing_rule, + NMPlatformRoutingRule *routing_rule, NMPlatformSignalChangeType change_type, gpointer user_data) { @@ -8724,10 +8723,10 @@ log_routing_rule(NMPlatform * self, } static void -log_qdisc(NMPlatform * self, +log_qdisc(NMPlatform *self, NMPObjectType obj_type, int ifindex, - NMPlatformQdisc * qdisc, + NMPlatformQdisc *qdisc, NMPlatformSignalChangeType change_type, gpointer user_data) { @@ -8737,10 +8736,10 @@ log_qdisc(NMPlatform * self, } static void -log_tfilter(NMPlatform * self, +log_tfilter(NMPlatform *self, NMPObjectType obj_type, int ifindex, - NMPlatformTfilter * tfilter, + NMPlatformTfilter *tfilter, NMPlatformSignalChangeType change_type, gpointer user_data) { @@ -8752,7 +8751,7 @@ log_tfilter(NMPlatform * self, /*****************************************************************************/ void -nm_platform_cache_update_emit_signal(NMPlatform * self, +nm_platform_cache_update_emit_signal(NMPlatform *self, NMPCacheOpsType cache_op, const NMPObject *obj_old, const NMPObject *obj_new) @@ -8760,7 +8759,7 @@ nm_platform_cache_update_emit_signal(NMPlatform * self, gboolean visible_new; gboolean visible_old; const NMPObject *o; - const NMPClass * klass; + const NMPClass *klass; int ifindex; nm_assert(NM_IN_SET((NMPlatformSignalChangeType) cache_op, @@ -8875,7 +8874,7 @@ const _NMPlatformVTableRouteUnion nm_platform_vtable_route = { const NMPlatformIPXRoute *b, NMPlatformIPRouteCmpType cmp_type)) nm_platform_ip4_route_cmp, .route_to_string = (const char *(*) (const NMPlatformIPXRoute *route, - char * buf, + char *buf, gsize len)) nm_platform_ip4_route_to_string, }, .v6 = @@ -8888,7 +8887,7 @@ const _NMPlatformVTableRouteUnion nm_platform_vtable_route = { const NMPlatformIPXRoute *b, NMPlatformIPRouteCmpType cmp_type)) nm_platform_ip6_route_cmp, .route_to_string = (const char *(*) (const NMPlatformIPXRoute *route, - char * buf, + char *buf, gsize len)) nm_platform_ip6_route_to_string, }, }; @@ -8898,7 +8897,7 @@ const _NMPlatformVTableRouteUnion nm_platform_vtable_route = { static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - NMPlatform * self = NM_PLATFORM(object); + NMPlatform *self = NM_PLATFORM(object); NMPlatformPrivate *priv = NM_PLATFORM_GET_PRIVATE(self); switch (prop_id) { @@ -8939,8 +8938,8 @@ nm_platform_init(NMPlatform *self) static GObject * constructor(GType type, guint n_construct_params, GObjectConstructParam *construct_params) { - GObject * object; - NMPlatform * self; + GObject *object; + NMPlatform *self; NMPlatformPrivate *priv; object = G_OBJECT_CLASS(nm_platform_parent_class) @@ -8958,7 +8957,7 @@ constructor(GType type, guint n_construct_params, GObjectConstructParam *constru static void finalize(GObject *object) { - NMPlatform * self = NM_PLATFORM(object); + NMPlatform *self = NM_PLATFORM(object); NMPlatformPrivate *priv = NM_PLATFORM_GET_PRIVATE(self); nm_clear_g_source(&priv->ip4_dev_route_blacklist_check_id); |