about summary refs log tree commit diff
path: root/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c')
-rw-r--r--src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c370
1 files changed, 185 insertions, 185 deletions
diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
index 263c9253..48c4cae9 100644
--- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
+++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
@@ -94,11 +94,11 @@ save_secret_flags(shvarFile *ifcfg, const char *key, NMSettingSecretFlags flags)
 }
 
 static void
-set_secret(shvarFile *          ifcfg,
-           GHashTable *         secrets,
-           const char *         key,
-           const char *         value,
-           const char *         flags_key,
+set_secret(shvarFile           *ifcfg,
+           GHashTable          *secrets,
+           const char          *key,
+           const char          *value,
+           const char          *flags_key,
            NMSettingSecretFlags flags)
 {
     /* Save secret flags */
@@ -114,14 +114,14 @@ set_secret(shvarFile *          ifcfg,
 static gboolean
 write_secrets(shvarFile *ifcfg, GHashTable *secrets, GError **error)
 {
-    nm_auto_shvar_file_close shvarFile *keyfile = NULL;
-    gs_free NMUtilsNamedValue *secrets_arr_free = NULL;
-    NMUtilsNamedValue          secrets_arr_static[30];
-    const NMUtilsNamedValue *  secrets_arr;
-    guint                      secrets_len;
-    GError *                   local       = NULL;
-    gboolean                   any_secrets = FALSE;
-    guint                      i;
+    nm_auto_shvar_file_close shvarFile *keyfile          = NULL;
+    gs_free NMUtilsNamedValue          *secrets_arr_free = NULL;
+    NMUtilsNamedValue                   secrets_arr_static[30];
+    const NMUtilsNamedValue            *secrets_arr;
+    guint                               secrets_len;
+    GError                             *local       = NULL;
+    gboolean                            any_secrets = FALSE;
+    guint                               i;
 
     keyfile = utils_get_keys_ifcfg(svFileGetName(ifcfg), TRUE);
     if (!keyfile) {
@@ -164,7 +164,7 @@ write_secrets(shvarFile *ifcfg, GHashTable *secrets, GError **error)
 
 typedef struct {
     const NMSetting8021xSchemeVtable *vtable;
-    const char *                      ifcfg_rh_key;
+    const char                       *ifcfg_rh_key;
 } Setting8021xSchemeVtable;
 
 static const Setting8021xSchemeVtable setting_8021x_scheme_vtable[] = {
@@ -184,23 +184,23 @@ static const Setting8021xSchemeVtable setting_8021x_scheme_vtable[] = {
 };
 
 static gboolean
-write_object(NMSetting8021x *                s_8021x,
-             shvarFile *                     ifcfg,
-             GHashTable *                    secrets,
-             GHashTable *                    blobs,
+write_object(NMSetting8021x                 *s_8021x,
+             shvarFile                      *ifcfg,
+             GHashTable                     *secrets,
+             GHashTable                     *blobs,
              const Setting8021xSchemeVtable *objtype,
              gboolean                        force_write,
-             GError **                       error)
+             GError                        **error)
 {
     NMSetting8021xCKScheme scheme;
-    const char *           value    = NULL;
-    GBytes *               blob     = NULL;
-    const char *           password = NULL;
+    const char            *value    = NULL;
+    GBytes                *blob     = NULL;
+    const char            *password = NULL;
     NMSettingSecretFlags   flags    = NM_SETTING_SECRET_FLAG_NONE;
     char                   secret_name[100];
     char                   secret_flags[sizeof(secret_name) + NM_STRLEN("_FLAGS")];
-    const char *           extension;
-    char *                 standard_file;
+    const char            *extension;
+    char                  *standard_file;
 
     g_return_val_if_fail(ifcfg != NULL, FALSE);
     g_return_val_if_fail(objtype != NULL, FALSE);
@@ -277,8 +277,8 @@ static gboolean
 write_blobs(GHashTable *blobs, GError **error)
 {
     GHashTableIter iter;
-    const char *   filename;
-    GBytes *       blob;
+    const char    *filename;
+    GBytes        *blob;
 
     if (!blobs)
         return TRUE;
@@ -318,14 +318,14 @@ write_blobs(GHashTable *blobs, GError **error)
 
 static gboolean
 write_8021x_certs(NMSetting8021x *s_8021x,
-                  GHashTable *    secrets,
-                  GHashTable *    blobs,
+                  GHashTable     *secrets,
+                  GHashTable     *blobs,
                   gboolean        phase2,
-                  shvarFile *     ifcfg,
-                  GError **       error)
+                  shvarFile      *ifcfg,
+                  GError        **error)
 {
     const Setting8021xSchemeVtable *pk_otype      = NULL;
-    gs_free char *                  value_to_free = NULL;
+    gs_free char                   *value_to_free = NULL;
 
     /* CA certificate */
     if (!write_object(
@@ -371,20 +371,20 @@ write_8021x_certs(NMSetting8021x *s_8021x,
 
 static gboolean
 write_8021x_setting(NMConnection *connection,
-                    shvarFile *   ifcfg,
-                    GHashTable *  secrets,
-                    GHashTable *  blobs,
+                    shvarFile    *ifcfg,
+                    GHashTable   *secrets,
+                    GHashTable   *blobs,
                     gboolean      wired,
-                    GError **     error)
+                    GError      **error)
 {
-    NMSetting8021x *        s_8021x;
+    NMSetting8021x         *s_8021x;
     NMSetting8021xAuthFlags auth_flags;
-    const char *            value, *match;
+    const char             *value, *match;
     gconstpointer           ptr;
-    GBytes *                bytes;
-    char *                  tmp = NULL;
-    GString *               phase2_auth;
-    GString *               str;
+    GBytes                 *bytes;
+    char                   *tmp = NULL;
+    GString                *phase2_auth;
+    GString                *str;
     guint32                 i, num;
     gsize                   size;
     int                     vint;
@@ -565,20 +565,20 @@ write_8021x_setting(NMConnection *connection,
 
 static gboolean
 write_wireless_security_setting(NMConnection *connection,
-                                shvarFile *   ifcfg,
-                                GHashTable *  secrets,
+                                shvarFile    *ifcfg,
+                                GHashTable   *secrets,
                                 gboolean      adhoc,
-                                gboolean *    no_8021x,
-                                GError **     error)
+                                gboolean     *no_8021x,
+                                GError      **error)
 {
-    NMSettingWirelessSecurity *        s_wsec;
-    const char *                       key_mgmt, *auth_alg, *key, *proto, *cipher;
-    const char *                       psk = NULL;
+    NMSettingWirelessSecurity         *s_wsec;
+    const char                        *key_mgmt, *auth_alg, *key, *proto, *cipher;
+    const char                        *psk = NULL;
     gboolean                           wep = FALSE, wpa = FALSE, dynamic_wep = FALSE;
     NMSettingWirelessSecurityWpsMethod wps_method;
-    char *                             tmp;
+    char                              *tmp;
     guint32                            i, num;
-    GString *                          str;
+    GString                           *str;
 
     s_wsec = nm_connection_get_setting_wireless_security(connection);
     if (!s_wsec) {
@@ -667,7 +667,7 @@ write_wireless_security_setting(NMConnection *connection,
     /* And write the new ones out */
     if (wep) {
         NMWepKeyType key_type;
-        const char * key_type_str = NULL;
+        const char  *key_type_str = NULL;
 
         /* Default WEP TX key index */
         svSetValueInt64(ifcfg,
@@ -711,7 +711,7 @@ write_wireless_security_setting(NMConnection *connection,
                     numbered_tag(tag, "KEY", i + 1);
 
                     /* Add 's:' prefix for ASCII keys */
-                    if (strlen(key) == 5 || strlen(key) == 13) {
+                    if (NM_IN_SET(strlen(key), 5, 13)) {
                         ascii_key = g_strdup_printf("s:%s", key);
                         key       = ascii_key;
                     }
@@ -759,7 +759,7 @@ write_wireless_security_setting(NMConnection *connection,
             g_free(tmp);
         }
     }
-    if (strlen(str->str) && (dynamic_wep == FALSE))
+    if (nm_str_not_empty(str->str) && !dynamic_wep)
         svSetValueStr(ifcfg, "CIPHER_PAIRWISE", str->str);
     g_string_free(str, TRUE);
 
@@ -809,17 +809,17 @@ write_wireless_security_setting(NMConnection *connection,
 
 static gboolean
 write_wireless_setting(NMConnection *connection,
-                       shvarFile *   ifcfg,
-                       GHashTable *  secrets,
-                       gboolean *    no_8021x,
-                       GError **     error)
+                       shvarFile    *ifcfg,
+                       GHashTable   *secrets,
+                       gboolean     *no_8021x,
+                       GError      **error)
 {
     NMSettingWireless *s_wireless;
-    GBytes *           ssid;
-    const guint8 *     ssid_data;
+    GBytes            *ssid;
+    const guint8      *ssid_data;
     gsize              ssid_len;
-    const char *       mode, *bssid;
-    const char *       device_mac, *cloned_mac;
+    const char        *mode, *bssid;
+    const char        *device_mac, *cloned_mac;
     guint32            mtu, chan, i;
     gboolean           adhoc = FALSE, hex_ssid = FALSE;
     const char *const *macaddr_blacklist;
@@ -1018,7 +1018,7 @@ static gboolean
 write_infiniband_setting(NMConnection *connection, shvarFile *ifcfg, GError **error)
 {
     NMSettingInfiniband *s_infiniband;
-    const char *         mac, *transport_mode, *parent;
+    const char          *mac, *transport_mode, *parent;
     guint32              mtu;
     int                  p_key;
 
@@ -1223,14 +1223,14 @@ _ethtool_gstring_prepare(GString **str, gboolean *is_first, char cmdline_flag, c
 static gboolean
 write_ethtool_setting(NMConnection *connection, shvarFile *ifcfg, GError **error)
 {
-    NMSettingWired *        s_wired;
-    NMSettingEthtool *      s_ethtool;
-    const char *            duplex;
+    NMSettingWired         *s_wired;
+    NMSettingEthtool       *s_ethtool;
+    const char             *duplex;
     guint32                 speed;
-    GString *               str = NULL;
+    GString                *str = NULL;
     gboolean                auto_negotiate;
     NMSettingWiredWakeOnLan wol;
-    const char *            wol_password;
+    const char             *wol_password;
 
     s_wired   = nm_connection_get_setting_wired(connection);
     s_ethtool = NM_SETTING_ETHTOOL(nm_connection_get_setting(connection, NM_TYPE_SETTING_ETHTOOL));
@@ -1300,7 +1300,7 @@ write_ethtool_setting(NMConnection *connection, shvarFile *ifcfg, GError **error
     if (s_ethtool) {
         NMEthtoolID          ethtool_id;
         NMSettingConnection *s_con;
-        const char *         iface;
+        const char          *iface;
         gboolean             is_first;
         guint32              u32;
         gboolean             b;
@@ -1398,7 +1398,7 @@ static char *
 vlan_priority_maplist_to_stringlist(NMSettingVlan *s_vlan, NMVlanPriorityMap map)
 {
     char **strlist;
-    char * value;
+    char  *value;
 
     if (map == NM_VLAN_INGRESS_MAP)
         g_object_get(G_OBJECT(s_vlan), NM_SETTING_VLAN_INGRESS_PRIORITY_MAP, &strlist, NULL);
@@ -1420,7 +1420,7 @@ static gboolean
 write_vlan_setting(NMConnection *connection, shvarFile *ifcfg, gboolean *wired, GError **error)
 {
     NMSettingVlan *s_vlan;
-    char *         tmp;
+    char          *tmp;
     guint32        vlan_flags = 0;
     gsize          s_buf_len;
     char           s_buf[50], *s_buf_ptr;
@@ -1486,7 +1486,7 @@ write_bond_setting(NMConnection *connection, shvarFile *ifcfg, gboolean *wired,
     num_opts = nm_setting_bond_get_num_options(s_bond);
     if (num_opts) {
         nm_auto_free_gstring GString *str = NULL;
-        const char *                  name, *value;
+        const char                   *name, *value;
 
         str = g_string_sized_new(64);
         for (i = 0; i < num_opts; i++) {
@@ -1511,7 +1511,7 @@ static gboolean
 write_team_setting(NMConnection *connection, shvarFile *ifcfg, gboolean *wired, GError **error)
 {
     NMSettingTeam *s_team;
-    const char *   config;
+    const char    *config;
 
     s_team = nm_connection_get_setting_team(connection);
     if (!s_team) {
@@ -1562,14 +1562,14 @@ write_team_setting(NMConnection *connection, shvarFile *ifcfg, gboolean *wired,
     })
 
 static gboolean
-write_bridge_vlans(NMSetting * setting,
+write_bridge_vlans(NMSetting  *setting,
                    gboolean    is_port,
-                   shvarFile * ifcfg,
+                   shvarFile  *ifcfg,
                    const char *key,
-                   GError **   error)
+                   GError    **error)
 {
-    GPtrArray *              vlans;
-    NMBridgeVlan *           vlan;
+    GPtrArray               *vlans;
+    NMBridgeVlan            *vlan;
     nm_auto_str_buf NMStrBuf strbuf = NM_STR_BUF_INIT(0, FALSE);
     guint                    i;
 
@@ -1608,8 +1608,8 @@ write_bridge_setting(NMConnection *connection, shvarFile *ifcfg, gboolean *wired
     guint64          u64;
     guint            u;
     gboolean         b;
-    const char *     s;
-    GString *        opts;
+    const char      *s;
+    GString         *opts;
 
     s_bridge = nm_connection_get_setting_bridge(connection);
     if (!s_bridge) {
@@ -1847,7 +1847,7 @@ write_bridge_port_setting(NMConnection *connection, shvarFile *ifcfg, GError **e
 {
     NMSettingBridgePort *s_port;
     guint32              u32;
-    GString *            string;
+    GString             *string;
 
     s_port = nm_connection_get_setting_bridge_port(connection);
     if (!s_port)
@@ -1903,7 +1903,7 @@ static gboolean
 write_team_port_setting(NMConnection *connection, shvarFile *ifcfg, GError **error)
 {
     NMSettingTeamPort *s_port;
-    const char *       config;
+    const char        *config;
 
     s_port = nm_connection_get_setting_team_port(connection);
     if (!s_port)
@@ -1946,9 +1946,9 @@ write_dcb_app(shvarFile *ifcfg, const char *tag, NMSettingDcbFlags flags, int pr
 typedef gboolean (*DcbGetBoolFunc)(NMSettingDcb *, guint);
 
 static void
-write_dcb_bool_array(shvarFile *       ifcfg,
-                     const char *      key,
-                     NMSettingDcb *    s_dcb,
+write_dcb_bool_array(shvarFile        *ifcfg,
+                     const char       *key,
+                     NMSettingDcb     *s_dcb,
                      NMSettingDcbFlags flags,
                      DcbGetBoolFunc    get_func)
 {
@@ -1967,9 +1967,9 @@ write_dcb_bool_array(shvarFile *       ifcfg,
 typedef guint (*DcbGetUintFunc)(NMSettingDcb *, guint);
 
 static void
-write_dcb_uint_array(shvarFile *       ifcfg,
-                     const char *      key,
-                     NMSettingDcb *    s_dcb,
+write_dcb_uint_array(shvarFile        *ifcfg,
+                     const char       *key,
+                     NMSettingDcb     *s_dcb,
                      NMSettingDcbFlags flags,
                      DcbGetUintFunc    get_func)
 {
@@ -1993,9 +1993,9 @@ write_dcb_uint_array(shvarFile *       ifcfg,
 }
 
 static void
-write_dcb_percent_array(shvarFile *       ifcfg,
-                        const char *      key,
-                        NMSettingDcb *    s_dcb,
+write_dcb_percent_array(shvarFile        *ifcfg,
+                        const char       *key,
+                        NMSettingDcb     *s_dcb,
                         NMSettingDcbFlags flags,
                         DcbGetUintFunc    get_func)
 {
@@ -2018,7 +2018,7 @@ write_dcb_percent_array(shvarFile *       ifcfg,
 static gboolean
 write_dcb_setting(NMConnection *connection, shvarFile *ifcfg, GError **error)
 {
-    NMSettingDcb *    s_dcb;
+    NMSettingDcb     *s_dcb;
     NMSettingDcbFlags flags;
 
     s_dcb = nm_connection_get_setting_dcb(connection);
@@ -2079,16 +2079,16 @@ write_dcb_setting(NMConnection *connection, shvarFile *ifcfg, GError **error)
 static void
 write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg)
 {
-    guint32              n, i;
+    guint32                       n, i;
     nm_auto_free_gstring GString *str = NULL;
-    const char *                  master, *master_iface = NULL, *type;
+    const char                   *master, *master_iface = NULL, *type;
     int                           vint;
     gint32                        vint32;
     NMSettingConnectionMdns       mdns;
     NMSettingConnectionLlmnr      llmnr;
     NMSettingConnectionDnsOverTls dns_over_tls;
     guint32                       vuint32;
-    const char *                  tmp, *mud_url;
+    const char                   *tmp, *mud_url;
 
     svSetValueStr(ifcfg, "NAME", nm_setting_connection_get_id(s_con));
     svSetValueStr(ifcfg, "UUID", nm_setting_connection_get_uuid(s_con));
@@ -2284,8 +2284,8 @@ static char *
 get_route_attributes_string(NMIPRoute *route, int family)
 {
     gs_free const char **names = NULL;
-    GVariant *           attr, *lock;
-    GString *            str;
+    GVariant            *attr, *lock;
+    GString             *str;
     guint                i, len;
 
     names = _nm_ip_route_get_attribute_names(route, TRUE, &len);
@@ -2369,7 +2369,7 @@ write_route_file_svformat(const char *filename, NMSettingIPConfig *s_ip4)
     num = nm_setting_ip_config_get_num_routes(s_ip4);
     for (i = 0; i < num; i++) {
         char          buf[INET_ADDRSTRLEN];
-        NMIPRoute *   route;
+        NMIPRoute    *route;
         guint32       netmask;
         gint64        metric;
         char          addr_key[64];
@@ -2409,7 +2409,7 @@ write_route_file_svformat(const char *filename, NMSettingIPConfig *s_ip4)
 static GString *
 write_route_file(NMSettingIPConfig *s_ip)
 {
-    GString *  contents;
+    GString   *contents;
     NMIPRoute *route;
     guint32    i, num;
     int        addr_family;
@@ -2424,7 +2424,7 @@ write_route_file(NMSettingIPConfig *s_ip)
 
     for (i = 0; i < num; i++) {
         gs_free char *options = NULL;
-        const char *  next_hop;
+        const char   *next_hop;
         gint64        metric;
 
         route    = nm_setting_ip_config_get_route(s_ip, i);
@@ -2454,9 +2454,9 @@ write_route_file(NMSettingIPConfig *s_ip)
 static gboolean
 write_proxy_setting(NMConnection *connection, shvarFile *ifcfg, GError **error)
 {
-    NMSettingProxy *     s_proxy;
+    NMSettingProxy      *s_proxy;
     NMSettingProxyMethod method;
-    const char *         pac_url, *pac_script;
+    const char          *pac_url, *pac_script;
 
     s_proxy = nm_connection_get_setting_proxy(connection);
     if (!s_proxy)
@@ -2489,7 +2489,7 @@ write_proxy_setting(NMConnection *connection, shvarFile *ifcfg, GError **error)
 static gboolean
 write_user_setting(NMConnection *connection, shvarFile *ifcfg, GError **error)
 {
-    NMSettingUser *    s_user;
+    NMSettingUser     *s_user;
     guint              i, len;
     const char *const *keys;
 
@@ -2521,9 +2521,9 @@ write_sriov_setting(NMConnection *connection, shvarFile *ifcfg)
     NMSettingSriov *s_sriov;
     guint           i, num = 0;
     NMTernary       b;
-    NMSriovVF *     vf;
+    NMSriovVF      *vf;
     char            key[32];
-    char *          str;
+    char           *str;
 
     s_sriov = NM_SETTING_SRIOV(nm_connection_get_setting(connection, NM_TYPE_SETTING_SRIOV));
     if (!s_sriov) {
@@ -2562,7 +2562,7 @@ write_tc_setting(NMConnection *connection, shvarFile *ifcfg)
 
     num_qdiscs = nm_setting_tc_config_get_num_qdiscs(s_tc);
     for (n = 1, i = 0; i < num_qdiscs; i++) {
-        NMTCQdisc *   qdisc;
+        NMTCQdisc    *qdisc;
         gs_free char *str = NULL;
 
         qdisc = nm_setting_tc_config_get_qdisc(s_tc, i);
@@ -2574,7 +2574,7 @@ write_tc_setting(NMConnection *connection, shvarFile *ifcfg)
 
     num_filters = nm_setting_tc_config_get_num_tfilters(s_tc);
     for (n = 1, i = 0; i < num_filters; i++) {
-        NMTCTfilter * tfilter;
+        NMTCTfilter  *tfilter;
         gs_free char *str = NULL;
 
         tfilter = nm_setting_tc_config_get_tfilter(s_tc, i);
@@ -2592,9 +2592,9 @@ static void
 write_match_setting(NMConnection *connection, shvarFile *ifcfg)
 {
     nm_auto_free_gstring GString *str = NULL;
-    NMSettingMatch *              s_match;
+    NMSettingMatch               *s_match;
     guint                         i, num;
-    const char *                  name;
+    const char                   *name;
 
     s_match = (NMSettingMatch *) nm_connection_get_setting(connection, NM_TYPE_SETTING_MATCH);
     if (!s_match)
@@ -2706,25 +2706,25 @@ write_dns_setting(shvarFile *ifcfg, NMConnection *connection, int addr_family)
 
 static void
 write_ip4_setting(NMConnection *connection,
-                  shvarFile *   ifcfg,
-                  shvarFile **  out_route_content_svformat,
-                  GString **    out_route_content)
+                  shvarFile    *ifcfg,
+                  shvarFile   **out_route_content_svformat,
+                  GString     **out_route_content)
 {
-    NMSettingIPConfig *    s_ip4;
-    const char *           value;
-    char *                 tmp;
-    char                   tag[64];
-    int                    j;
-    guint                  i, num, n;
-    gint64                 route_metric;
-    NMIPRouteTableSyncMode route_table;
-    int                    priority;
-    int                    timeout;
+    NMSettingIPConfig            *s_ip4;
+    const char                   *value;
+    char                         *tmp;
+    char                          tag[64];
+    int                           j;
+    guint                         i, num, n;
+    gint64                        route_metric;
+    NMIPRouteTableSyncMode        route_table;
+    int                           priority;
+    int                           timeout;
     nm_auto_free_gstring GString *str    = NULL;
-    const char *                  method = NULL;
+    const char                   *method = NULL;
     gboolean                      has_netmask;
     NMDhcpHostnameFlags           flags;
-    const char *const *           strv;
+    const char *const            *strv;
 
     NM_SET_OUT(out_route_content_svformat, NULL);
     NM_SET_OUT(out_route_content, NULL);
@@ -2905,17 +2905,17 @@ static void
 write_ip4_aliases(NMConnection *connection, const char *base_ifcfg_path)
 {
     NMSettingIPConfig *s_ip4;
-    gs_free char *     base_ifcfg_dir = NULL, *base_ifcfg_name = NULL;
-    const char *       base_name;
+    gs_free char      *base_ifcfg_dir = NULL, *base_ifcfg_name = NULL;
+    const char        *base_name;
     int                i, num, base_ifcfg_name_len, base_name_len;
-    GDir *             dir;
+    GDir              *dir;
 
     base_ifcfg_dir      = g_path_get_dirname(base_ifcfg_path);
     base_ifcfg_name     = g_path_get_basename(base_ifcfg_path);
     base_ifcfg_name_len = strlen(base_ifcfg_name);
     if (!g_str_has_prefix(base_ifcfg_name, IFCFG_TAG))
         g_return_if_reached();
-    base_name     = base_ifcfg_name + strlen(IFCFG_TAG);
+    base_name     = base_ifcfg_name + NM_STRLEN(IFCFG_TAG);
     base_name_len = strlen(base_name);
 
     /* Remove all existing aliases for this file first */
@@ -2946,11 +2946,11 @@ write_ip4_aliases(NMConnection *connection, const char *base_ifcfg_path)
 
     num = nm_setting_ip_config_get_num_addresses(s_ip4);
     for (i = 0; i < num; i++) {
-        GVariant *   label_var;
-        const char * label, *p;
-        char *       path;
+        GVariant    *label_var;
+        const char  *label, *p;
+        char        *path;
         NMIPAddress *addr;
-        shvarFile *  ifcfg;
+        shvarFile   *ifcfg;
 
         addr = nm_setting_ip_config_get_address(s_ip4, i);
 
@@ -2987,17 +2987,17 @@ write_ip4_aliases(NMConnection *connection, const char *base_ifcfg_path)
 static void
 write_ip6_setting(NMConnection *connection, shvarFile *ifcfg, GString **out_route6_content)
 {
-    NMSettingIPConfig *           s_ip6;
-    const char *                  value;
+    NMSettingIPConfig            *s_ip6;
+    const char                   *value;
     guint                         i, num;
     int                           priority;
-    NMIPAddress *                 addr;
+    NMIPAddress                  *addr;
     gint64                        route_metric;
     NMIPRouteTableSyncMode        route_table;
-    GString *                     ip_str1, *ip_str2, *ip_ptr;
+    GString                      *ip_str1, *ip_str2, *ip_ptr;
     NMSettingIP6ConfigAddrGenMode addr_gen_mode;
     NMDhcpHostnameFlags           flags;
-    const char *                  hostname;
+    const char                   *hostname;
     int                           timeout;
 
     NM_SET_OUT(out_route6_content, NULL);
@@ -3183,7 +3183,7 @@ write_ip_routing_rules(NMConnection *connection, shvarFile *ifcfg, gboolean rout
 
         num = nm_setting_ip_config_get_num_routing_rules(s_ip);
         for (i = 0; i < num; i++) {
-            NMIPRoutingRule *   rule = nm_setting_ip_config_get_routing_rule(s_ip, i);
+            NMIPRoutingRule    *rule = nm_setting_ip_config_get_routing_rule(s_ip, i);
             gs_free const char *s    = NULL;
             char                key[64];
 
@@ -3222,38 +3222,38 @@ escape_id(const char *id)
 }
 
 static gboolean
-do_write_construct(NMConnection *                  connection,
-                   const char *                    ifcfg_dir,
-                   const char *                    filename,
+do_write_construct(NMConnection                   *connection,
+                   const char                     *ifcfg_dir,
+                   const char                     *filename,
                    NMSIfcfgRHWriterAllowFilenameCb allow_filename_cb,
                    gpointer                        allow_filename_user_data,
-                   shvarFile **                    out_ifcfg,
-                   GHashTable **                   out_blobs,
-                   GHashTable **                   out_secrets,
-                   gboolean *                      out_route_ignore,
-                   shvarFile **                    out_route_content_svformat,
-                   GString **                      out_route_content,
-                   GString **                      out_route6_content,
-                   GError **                       error)
+                   shvarFile                     **out_ifcfg,
+                   GHashTable                    **out_blobs,
+                   GHashTable                    **out_secrets,
+                   gboolean                       *out_route_ignore,
+                   shvarFile                     **out_route_content_svformat,
+                   GString                       **out_route_content,
+                   GString                       **out_route6_content,
+                   GError                        **error)
 {
-    NMSettingConnection *    s_con;
+    NMSettingConnection                *s_con;
     nm_auto_shvar_file_close shvarFile *ifcfg = NULL;
-    const char *                        ifcfg_name;
-    gs_free char *                      ifcfg_name_free = NULL;
-    gs_free char *                      route_path      = NULL;
-    gs_free char *                      route6_path     = NULL;
-    const char *                        type;
-    gs_unref_hashtable GHashTable *blobs   = NULL;
-    gs_unref_hashtable GHashTable *secrets = NULL;
-    gboolean                       wired;
-    gboolean                       no_8021x;
-    gboolean                       route_path_is_svformat;
-    gboolean                       has_complex_routes_v4;
-    gboolean                       has_complex_routes_v6;
-    gboolean                       route_ignore;
+    const char                         *ifcfg_name;
+    gs_free char                       *ifcfg_name_free = NULL;
+    gs_free char                       *route_path      = NULL;
+    gs_free char                       *route6_path     = NULL;
+    const char                         *type;
+    gs_unref_hashtable GHashTable      *blobs   = NULL;
+    gs_unref_hashtable GHashTable      *secrets = NULL;
+    gboolean                            wired;
+    gboolean                            no_8021x;
+    gboolean                            route_path_is_svformat;
+    gboolean                            has_complex_routes_v4;
+    gboolean                            has_complex_routes_v6;
+    gboolean                            route_ignore;
     nm_auto_shvar_file_close shvarFile *route_content_svformat = NULL;
-    nm_auto_free_gstring GString *route_content                = NULL;
-    nm_auto_free_gstring GString *route6_content               = NULL;
+    nm_auto_free_gstring GString       *route_content          = NULL;
+    nm_auto_free_gstring GString       *route6_content         = NULL;
 
     nm_assert(NM_IS_CONNECTION(connection));
     nm_assert(_nm_connection_verify(connection, NULL) == NM_SETTING_VERIFY_SUCCESS);
@@ -3478,14 +3478,14 @@ do_write_construct(NMConnection *                  connection,
 
 static gboolean
 do_write_to_disk(NMConnection *connection,
-                 shvarFile *   ifcfg,
-                 GHashTable *  blobs,
-                 GHashTable *  secrets,
+                 shvarFile    *ifcfg,
+                 GHashTable   *blobs,
+                 GHashTable   *secrets,
                  gboolean      route_ignore,
-                 shvarFile *   route_content_svformat,
-                 GString *     route_content,
-                 GString *     route6_content,
-                 GError **     error)
+                 shvarFile    *route_content_svformat,
+                 GString      *route_content,
+                 GString      *route6_content,
+                 GError      **error)
 {
     /* From here on, we persist data to disk. Before, it was all in-memory
      * only. But we loaded the ifcfg files from disk, and managled our
@@ -3549,23 +3549,23 @@ do_write_to_disk(NMConnection *connection,
 }
 
 gboolean
-nms_ifcfg_rh_writer_write_connection(NMConnection *                  connection,
-                                     const char *                    ifcfg_dir,
-                                     const char *                    filename,
+nms_ifcfg_rh_writer_write_connection(NMConnection                   *connection,
+                                     const char                     *ifcfg_dir,
+                                     const char                     *filename,
                                      NMSIfcfgRHWriterAllowFilenameCb allow_filename_cb,
                                      gpointer                        allow_filename_user_data,
-                                     char **                         out_filename,
-                                     NMConnection **                 out_reread,
-                                     gboolean *                      out_reread_same,
-                                     GError **                       error)
+                                     char                          **out_filename,
+                                     NMConnection                  **out_reread,
+                                     gboolean                       *out_reread_same,
+                                     GError                        **error)
 {
     nm_auto_shvar_file_close shvarFile *ifcfg                  = NULL;
-    nm_auto_free_gstring GString *route_content                = NULL;
-    gboolean                      route_ignore                 = FALSE;
+    nm_auto_free_gstring GString       *route_content          = NULL;
+    gboolean                            route_ignore           = FALSE;
     nm_auto_shvar_file_close shvarFile *route_content_svformat = NULL;
-    nm_auto_free_gstring GString *route6_content               = NULL;
-    gs_unref_hashtable GHashTable *secrets                     = NULL;
-    gs_unref_hashtable GHashTable *blobs                       = NULL;
+    nm_auto_free_gstring GString       *route6_content         = NULL;
+    gs_unref_hashtable GHashTable      *secrets                = NULL;
+    gs_unref_hashtable GHashTable      *blobs                  = NULL;
 
     nm_assert(!out_reread || !*out_reread);
 
@@ -3611,8 +3611,8 @@ nms_ifcfg_rh_writer_write_connection(NMConnection *                  connection,
     if (out_reread || out_reread_same) {
         gs_unref_object NMConnection *reread      = NULL;
         gboolean                      reread_same = FALSE;
-        gs_free_error GError *local               = NULL;
-        gs_free char *        unhandled           = NULL;
+        gs_free_error GError         *local       = NULL;
+        gs_free char                 *unhandled   = NULL;
 
         reread = connection_from_file(svFileGetName(ifcfg), &unhandled, &local, NULL);
         nm_assert((NM_IS_CONNECTION(reread) && !local) || (!reread && local));