diff options
| author | Michael Biebl <biebl@debian.org> | 2011-08-23 19:16:47 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2011-08-23 19:16:47 +0200 |
| commit | 263bf4c0c89bb88dc995acd9a6a2de9095fbd461 (patch) | |
| tree | 7224326afe367409e7150e49fad9029f81fe24b8 /src/settings/plugins/ifcfg-rh/writer.c | |
| parent | d465e5fac63f36bcf4069e36827f4b62c494556d (diff) | |
Imported Upstream version 0.9.0 upstream/0.9.0
Diffstat (limited to 'src/settings/plugins/ifcfg-rh/writer.c')
| -rw-r--r-- | src/settings/plugins/ifcfg-rh/writer.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c index 6b66b232..192226ac 100644 --- a/src/settings/plugins/ifcfg-rh/writer.c +++ b/src/settings/plugins/ifcfg-rh/writer.c @@ -758,6 +758,7 @@ write_wireless_setting (NMConnection *connection, char buf[33]; guint32 mtu, chan, i; gboolean adhoc = FALSE, hex_ssid = FALSE; + const GSList *macaddr_blacklist; s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); if (!s_wireless) { @@ -786,6 +787,23 @@ write_wireless_setting (NMConnection *connection, g_free (tmp); } + svSetValue (ifcfg, "HWADDR_BLACKLIST", NULL, FALSE); + macaddr_blacklist = nm_setting_wireless_get_mac_address_blacklist (s_wireless); + if (macaddr_blacklist) { + const GSList *iter; + GString *blacklist_str = g_string_new (NULL); + + for (iter = macaddr_blacklist; iter; iter = g_slist_next (iter)) { + g_string_append (blacklist_str, iter->data); + g_string_append_c (blacklist_str, ' '); + + } + if (blacklist_str->len > 0) + g_string_truncate (blacklist_str, blacklist_str->len - 1); + svSetValue (ifcfg, "HWADDR_BLACKLIST", blacklist_str->str, FALSE); + g_string_free (blacklist_str, TRUE); + } + svSetValue (ifcfg, "MTU", NULL, FALSE); mtu = nm_setting_wireless_get_mtu (s_wireless); if (mtu) { @@ -934,6 +952,7 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) guint32 mtu, num_opts, i; const GPtrArray *s390_subchannels; GString *str; + const GSList *macaddr_blacklist; s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); if (!s_wired) { @@ -961,6 +980,23 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) g_free (tmp); } + svSetValue (ifcfg, "HWADDR_BLACKLIST", NULL, FALSE); + macaddr_blacklist = nm_setting_wired_get_mac_address_blacklist (s_wired); + if (macaddr_blacklist) { + const GSList *iter; + GString *blacklist_str = g_string_new (NULL); + + for (iter = macaddr_blacklist; iter; iter = g_slist_next (iter)) { + g_string_append (blacklist_str, iter->data); + g_string_append_c (blacklist_str, ' '); + + } + if (blacklist_str->len > 0) + g_string_truncate (blacklist_str, blacklist_str->len - 1); + svSetValue (ifcfg, "HWADDR_BLACKLIST", blacklist_str->str, FALSE); + g_string_free (blacklist_str, TRUE); + } + svSetValue (ifcfg, "MTU", NULL, FALSE); mtu = nm_setting_wired_get_mtu (s_wired); if (mtu) { @@ -1316,13 +1352,14 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) if (utils_has_route_file_new_syntax (route_path)) { shvarFile *routefile; - g_free (route_path); routefile = utils_get_route_ifcfg (ifcfg->fileName, TRUE); if (!routefile) { g_set_error (error, IFCFG_PLUGIN_ERROR, 0, - "Could not create route file '%s'", routefile->fileName); + "Could not create route file '%s'", route_path); + g_free (route_path); goto out; } + g_free (route_path); num = nm_setting_ip4_config_get_num_routes (s_ip4); for (i = 0; i < 256; i++) { |