diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2014-10-20 17:33:00 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2014-10-23 18:34:39 +0200 |
commit | 8b1447a3a413160313bc468f630d453b2be9df8c (patch) | |
tree | be389bd9e2bf10d491a5f2e839a150f91052e69a /src | |
parent | 1c9b16b2f2b6d3e925155d058134efc620766f0e (diff) | |
download | NetworkManager-8b1447a3a413160313bc468f630d453b2be9df8c.tar.gz |
ifcfg-rh: add support for MODE=Aplr/ap
It is an extension against initscripts. However, we have many other Wi-Fi
related extensions. So the NM-written ifcfg file will not be 100% backwards
compatible anyway.
Moreover, initscripts changed from using iwconfig to iw and dropped support
(accidently?) for some traditional variable, like KEY1-KEY4, CHANNEL, etc.
They should be fixed bring back by initscripts.
https://git.fedorahosted.org/cgit/initscripts.git/commit/sysconfig/network-scripts/ifup-wireless?id=ddda5f6f818831b1fa37337be0ac9c0f619df1ca
Diffstat (limited to 'src')
-rw-r--r-- | src/settings/plugins/ifcfg-rh/reader.c | 4 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/writer.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 60ca5b52c6..6994f6af93 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -3379,11 +3379,13 @@ make_wireless_setting (shvarFile *ifcfg, if (!strcmp (lcase, "ad-hoc")) { mode = "adhoc"; + } else if (!strcmp (lcase, "ap")) { + mode = "ap"; } else if (!strcmp (lcase, "managed") || !strcmp (lcase, "auto")) { mode = "infrastructure"; } else { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, - "Invalid mode '%s' (not 'Ad-Hoc', 'Managed', or 'Auto')", + "Invalid mode '%s' (not 'Ad-Hoc', 'Ap', 'Managed', or 'Auto')", lcase); g_free (lcase); goto error; diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c index 90bbe71eb2..3c6ea08401 100644 --- a/src/settings/plugins/ifcfg-rh/writer.c +++ b/src/settings/plugins/ifcfg-rh/writer.c @@ -908,6 +908,8 @@ write_wireless_setting (NMConnection *connection, } else if (!strcmp (mode, "adhoc")) { svSetValue (ifcfg, "MODE", "Ad-Hoc", FALSE); adhoc = TRUE; + } else if (!strcmp (mode, "ap")) { + svSetValue (ifcfg, "MODE", "Ap", FALSE); } else { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED, "Invalid mode '%s' in '%s' setting", |