summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-07-08 17:24:36 +0200
committerThomas Haller <thaller@redhat.com>2021-07-08 17:24:36 +0200
commite16c50f507703f15a550b4ef80448dcbd3a85131 (patch)
tree569067f7fc0662cfe7ca4b078c4253cfc0980e15
parentf929bc9945e334ff89cee6598ecffcd749f52c93 (diff)
parent94a5ae58aeafb84100fee654307c69db53e0944d (diff)
downloadNetworkManager-e16c50f507703f15a550b4ef80448dcbd3a85131.tar.gz
all: merge branch 'th/device-connect-dummy'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/915
-rw-r--r--po/ar.po2
-rw-r--r--po/as.po2
-rw-r--r--po/be@latin.po2
-rw-r--r--po/bg.po2
-rw-r--r--po/bn_IN.po2
-rw-r--r--po/bs.po2
-rw-r--r--po/ca.po2
-rw-r--r--po/cs.po2
-rw-r--r--po/da.po2
-rw-r--r--po/de.po2
-rw-r--r--po/dz.po2
-rw-r--r--po/el.po2
-rw-r--r--po/en_CA.po2
-rw-r--r--po/en_GB.po2
-rw-r--r--po/eo.po2
-rw-r--r--po/es.po2
-rw-r--r--po/et.po2
-rw-r--r--po/eu.po2
-rw-r--r--po/fi.po2
-rw-r--r--po/fr.po2
-rw-r--r--po/gd.po2
-rw-r--r--po/gl.po2
-rw-r--r--po/gu.po2
-rw-r--r--po/he.po2
-rw-r--r--po/hi.po2
-rw-r--r--po/hr.po2
-rw-r--r--po/hu.po2
-rw-r--r--po/id.po2
-rw-r--r--po/it.po2
-rw-r--r--po/ja.po2
-rw-r--r--po/ka.po2
-rw-r--r--po/kn.po2
-rw-r--r--po/ko.po2
-rw-r--r--po/ku.po2
-rw-r--r--po/lt.po2
-rw-r--r--po/lv.po2
-rw-r--r--po/mk.po2
-rw-r--r--po/ml.po2
-rw-r--r--po/mr.po2
-rw-r--r--po/nb.po2
-rw-r--r--po/ne.po2
-rw-r--r--po/nl.po2
-rw-r--r--po/oc.po2
-rw-r--r--po/or.po2
-rw-r--r--po/pa.po2
-rw-r--r--po/pl.po2
-rw-r--r--po/pt.po2
-rw-r--r--po/pt_BR.po2
-rw-r--r--po/ru.po2
-rw-r--r--po/rw.po2
-rw-r--r--po/sk.po2
-rw-r--r--po/sl.po2
-rw-r--r--po/sq.po2
-rw-r--r--po/sr.po2
-rw-r--r--po/sr@latin.po2
-rw-r--r--po/sv.po2
-rw-r--r--po/ta.po2
-rw-r--r--po/te.po2
-rw-r--r--po/th.po2
-rw-r--r--po/tr.po2
-rw-r--r--po/uk.po2
-rw-r--r--po/vi.po2
-rw-r--r--po/wa.po2
-rw-r--r--po/zh_CN.po2
-rw-r--r--po/zh_HK.po2
-rw-r--r--po/zh_TW.po2
-rw-r--r--src/core/NetworkManagerUtils.c49
-rw-r--r--src/core/NetworkManagerUtils.h63
-rw-r--r--src/core/devices/nm-device-dummy.c24
-rw-r--r--src/libnm-client-impl/nm-device.c2
-rw-r--r--src/libnm-core-impl/nm-connection.c30
-rw-r--r--src/libnm-core-impl/tests/test-setting.c40
-rw-r--r--src/libnm-core-public/nm-connection.h15
-rw-r--r--src/nmcli/connections.c115
74 files changed, 299 insertions, 171 deletions
diff --git a/po/ar.po b/po/ar.po
index 69fba58a09..756da6e8e2 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -1131,7 +1131,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/as.po b/po/as.po
index df469693d8..a23b1d649a 100644
--- a/po/as.po
+++ b/po/as.po
@@ -1185,7 +1185,7 @@ msgstr "ত্ৰুটি: সংযোগ বৈধ নহয়: %s\n"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/be@latin.po b/po/be@latin.po
index 258022829d..65a234efcf 100644
--- a/po/be@latin.po
+++ b/po/be@latin.po
@@ -1092,7 +1092,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/bg.po b/po/bg.po
index 9f37de0ec9..242592e70f 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -1179,7 +1179,7 @@ msgstr "връзката е премахната"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/bn_IN.po b/po/bn_IN.po
index 14c4dce1bf..d1006a04e7 100644
--- a/po/bn_IN.po
+++ b/po/bn_IN.po
@@ -1204,7 +1204,7 @@ msgstr "ত্রুটি: সংযোগ বৈধ নয়: %s\n"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/bs.po b/po/bs.po
index 644a571dd1..3e7bff2632 100644
--- a/po/bs.po
+++ b/po/bs.po
@@ -1125,7 +1125,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/ca.po b/po/ca.po
index 4036493d71..617c42ccef 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -1189,7 +1189,7 @@ msgstr "La connexió no era vàlida: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "No han concordat els noms d'interfície del dispositiu i la connexió."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/cs.po b/po/cs.po
index 5b805d74d0..fd4db16db3 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -1149,7 +1149,7 @@ msgstr "Připojení nebylo platné: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/da.po b/po/da.po
index c87368b05f..7d69b0d962 100644
--- a/po/da.po
+++ b/po/da.po
@@ -1163,7 +1163,7 @@ msgstr "forbindelsen blev fjernet"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/de.po b/po/de.po
index 3945ec3a8c..8b8a7aa435 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1208,7 +1208,7 @@ msgstr "Die Verbindung war ungültig: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
"Die Schnittstellennamen des Geräts und der Verbindung stimmen nicht überein."
diff --git a/po/dz.po b/po/dz.po
index 5687db8e0e..106eb57f5c 100644
--- a/po/dz.po
+++ b/po/dz.po
@@ -1126,7 +1126,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/el.po b/po/el.po
index 2bfbf88c97..e97780eabb 100644
--- a/po/el.po
+++ b/po/el.po
@@ -1228,7 +1228,7 @@ msgstr "Σφάλμα: η σύνδεση δεν είναι έγκυρη: %s\n"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/en_CA.po b/po/en_CA.po
index e4a5ff0fe0..6d5f570e9f 100644
--- a/po/en_CA.po
+++ b/po/en_CA.po
@@ -1151,7 +1151,7 @@ msgstr "VPN connection '%s' said:"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/en_GB.po b/po/en_GB.po
index a7e96adcd9..87fb3a2a14 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -1178,7 +1178,7 @@ msgstr "the connection was removed"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/eo.po b/po/eo.po
index fff50ce108..72e8e41b66 100644
--- a/po/eo.po
+++ b/po/eo.po
@@ -1134,7 +1134,7 @@ msgstr "la konekto estis forigita"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/es.po b/po/es.po
index 7cbbf69bf5..a09570f744 100644
--- a/po/es.po
+++ b/po/es.po
@@ -1188,7 +1188,7 @@ msgstr "La conexión no era válida: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
"Los nombres de interfaz del dispositivo y de la conexión no coincidieron."
diff --git a/po/et.po b/po/et.po
index c177d169f4..dcad290cee 100644
--- a/po/et.po
+++ b/po/et.po
@@ -1111,7 +1111,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/eu.po b/po/eu.po
index 6cd8ae53ff..5e6e6dd590 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -1160,7 +1160,7 @@ msgstr "konexioa kendu egin da"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/fi.po b/po/fi.po
index aa6d394237..477ab68a06 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -1160,7 +1160,7 @@ msgstr "yhteys poistettu"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/fr.po b/po/fr.po
index f679434eef..2c9e973f0c 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -1189,7 +1189,7 @@ msgstr "La connexion n'était pas valide : %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
"Les noms d'interface du périphérique et de la connexion ne correspondaient "
"pas."
diff --git a/po/gd.po b/po/gd.po
index d8f3503b2f..d1d80cb421 100644
--- a/po/gd.po
+++ b/po/gd.po
@@ -1138,7 +1138,7 @@ msgstr "Chan eil rèiteachadh an IP dligheach tuilleadh"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/gl.po b/po/gl.po
index 8d4924f6cc..be1506498e 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -1193,7 +1193,7 @@ msgstr "eliminouse a conexión"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/gu.po b/po/gu.po
index 370c330348..4aa922072f 100644
--- a/po/gu.po
+++ b/po/gu.po
@@ -1193,7 +1193,7 @@ msgstr "ભૂલ: જોડાણ યોગ્ય નથી: %s\n"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/he.po b/po/he.po
index 6c129e88e6..7f064b0262 100644
--- a/po/he.po
+++ b/po/he.po
@@ -1092,7 +1092,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/hi.po b/po/hi.po
index ea7225be4b..39149dc423 100644
--- a/po/hi.po
+++ b/po/hi.po
@@ -1175,7 +1175,7 @@ msgstr "त्रुटि: कनेक्शन वैध नहीं है:
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/hr.po b/po/hr.po
index a06b541dab..8720f50fa5 100644
--- a/po/hr.po
+++ b/po/hr.po
@@ -1152,7 +1152,7 @@ msgstr "veza je uklonjena"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/hu.po b/po/hu.po
index b5dc080ba6..8ac1f85998 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -1204,7 +1204,7 @@ msgstr "a kapcsolat eltávolításra került"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/id.po b/po/id.po
index 31154c13b0..6cddcd61ee 100644
--- a/po/id.po
+++ b/po/id.po
@@ -1131,7 +1131,7 @@ msgstr "Koneksi tidak valid: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "Nama-nama antar muka perangkat dan koneksi tidak cocok."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/it.po b/po/it.po
index d940846ac5..6dfe8cdccb 100644
--- a/po/it.po
+++ b/po/it.po
@@ -1174,7 +1174,7 @@ msgstr "La connessione non era valida: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
"Il nome dell'interfaccia del dispositivo e la connessione non corrispondono."
diff --git a/po/ja.po b/po/ja.po
index ab6620cc6f..196293ac76 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -1129,7 +1129,7 @@ msgstr "接続は有効ではありませんでした: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "デバイスと接続のインターフェース名が一致しませんでした。"
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/ka.po b/po/ka.po
index b7bcec321b..86e5c96cae 100644
--- a/po/ka.po
+++ b/po/ka.po
@@ -1151,7 +1151,7 @@ msgstr "VPN-შეერთება '%s' არასწორად იყო
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/kn.po b/po/kn.po
index 5632b1ea7c..792f8b8533 100644
--- a/po/kn.po
+++ b/po/kn.po
@@ -1183,7 +1183,7 @@ msgstr "ದೋಷ: ಸಂಪರ್ಕವು ಮಾನ್ಯವಾದುದಾಗ
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/ko.po b/po/ko.po
index 65c84808d1..73fbfbdb9a 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -1133,7 +1133,7 @@ msgstr "연결이 유효하지 않았음: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "장치와 연결의 인터페이스 이름이 일치하지 않습니다."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/ku.po b/po/ku.po
index 4deb7c5ecc..d9c3804db3 100644
--- a/po/ku.po
+++ b/po/ku.po
@@ -1132,7 +1132,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/lt.po b/po/lt.po
index fc253dcafe..517ed50ecc 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -1183,7 +1183,7 @@ msgstr "ryšys buvo pašalintas"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/lv.po b/po/lv.po
index bfa8868c60..158c57bc49 100644
--- a/po/lv.po
+++ b/po/lv.po
@@ -1153,7 +1153,7 @@ msgstr "VPN savienojums '%s' nebija korekti konfigurēts."
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/mk.po b/po/mk.po
index a47d2c9ab0..3882663b9b 100644
--- a/po/mk.po
+++ b/po/mk.po
@@ -1098,7 +1098,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/ml.po b/po/ml.po
index 1fe70ab8a3..f82ffe2522 100644
--- a/po/ml.po
+++ b/po/ml.po
@@ -1194,7 +1194,7 @@ msgstr "പിശക്: കണക്ഷന്‍ ശരിയല്ല: %s\n"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/mr.po b/po/mr.po
index b2410591b9..ea2aaffb5b 100644
--- a/po/mr.po
+++ b/po/mr.po
@@ -1169,7 +1169,7 @@ msgstr "त्रुटी: जोडणी वैध नाही: %s\n"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/nb.po b/po/nb.po
index 1a5ff4f250..d9f9d3123c 100644
--- a/po/nb.po
+++ b/po/nb.po
@@ -1099,7 +1099,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/ne.po b/po/ne.po
index f22918b66c..b0fee386fa 100644
--- a/po/ne.po
+++ b/po/ne.po
@@ -1129,7 +1129,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/nl.po b/po/nl.po
index 0a86d7a39d..08d06b7515 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -1106,7 +1106,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/oc.po b/po/oc.po
index 79cd73f3c8..e6b8650233 100644
--- a/po/oc.po
+++ b/po/oc.po
@@ -1170,7 +1170,7 @@ msgstr "La connexion es invalida : %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/or.po b/po/or.po
index d078fe9514..d1346370d2 100644
--- a/po/or.po
+++ b/po/or.po
@@ -1182,7 +1182,7 @@ msgstr "ତୃଟି: ସଂଯୋଗଟି ବୈଧ ନୁହଁ: %s\n"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/pa.po b/po/pa.po
index 5887a33861..07ab8e2b4b 100644
--- a/po/pa.po
+++ b/po/pa.po
@@ -1130,7 +1130,7 @@ msgstr "ਕਨੈਕਸ਼ਨ ਢੁੱਕਵਾਂ ਨਹੀ ਸੀ: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/pl.po b/po/pl.po
index 07d9c1c359..beb27e3aae 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -1147,7 +1147,7 @@ msgstr "Połączenie jest nieprawidłowe: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "Nazwy interfejsu urządzenia i połączenia się nie zgadzają."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/pt.po b/po/pt.po
index 0b29718b3b..4dce7e618c 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -1125,7 +1125,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 86f604ae85..db5c7f9b8a 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -1162,7 +1162,7 @@ msgstr "A conexão não era válida: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "Os nomes de interface do dispositivo e a conexão não correspondem."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/ru.po b/po/ru.po
index af45ff5ad9..4087b269fd 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -1164,7 +1164,7 @@ msgstr "Это подключение не было действительным
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "Имена интерфейсов устройства и подключения не совпадают."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/rw.po b/po/rw.po
index be1249a23c..272d097bdb 100644
--- a/po/rw.po
+++ b/po/rw.po
@@ -1147,7 +1147,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/sk.po b/po/sk.po
index 18796eabd4..4042e5caeb 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -1146,7 +1146,7 @@ msgstr "VPN spojenie '%s' nebolo správne nakonfigurované."
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/sl.po b/po/sl.po
index aa8582c25d..c02650bd44 100644
--- a/po/sl.po
+++ b/po/sl.po
@@ -1189,7 +1189,7 @@ msgstr "povezava je odstranjena"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/sq.po b/po/sq.po
index fed76fc55a..279b75d5a8 100644
--- a/po/sq.po
+++ b/po/sq.po
@@ -1123,7 +1123,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/sr.po b/po/sr.po
index afef5fedac..81b649bf66 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -1162,7 +1162,7 @@ msgstr "веза је уклоњена"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/sr@latin.po b/po/sr@latin.po
index 595668a98a..2c33b60275 100644
--- a/po/sr@latin.po
+++ b/po/sr@latin.po
@@ -1165,7 +1165,7 @@ msgstr "veza je uklonjena"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/sv.po b/po/sv.po
index 2cad05de83..922397e9be 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -1160,7 +1160,7 @@ msgstr "Anslutningen var inte giltig: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "Gränssnittsnamnen på enheten och anslutningen matchar inte."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/ta.po b/po/ta.po
index a072c6739c..874072783e 100644
--- a/po/ta.po
+++ b/po/ta.po
@@ -1167,7 +1167,7 @@ msgstr "இணைப்பு செல்லுபடியாகாதது:
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "சாதனம் மற்றும் இணைப்பின் இடைமுகப் பெயர்கள் பொருந்தவில்லை."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/te.po b/po/te.po
index f3d3b5f12a..72ee9a34f1 100644
--- a/po/te.po
+++ b/po/te.po
@@ -1170,7 +1170,7 @@ msgstr "దోషం: అనుసంధానం చెల్లునది
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/th.po b/po/th.po
index 93b72422d2..c09ce0611d 100644
--- a/po/th.po
+++ b/po/th.po
@@ -1152,7 +1152,7 @@ msgstr "การเชื่อมต่อ VPN '%s' ตั้งค่าไ
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/tr.po b/po/tr.po
index dc1ec77bfc..293bd8c5f3 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -1186,7 +1186,7 @@ msgstr "Bağlantı geçerli değildi: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "Aygıtın arayüz isimleri ve bağlantı eşleşmiyor."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/uk.po b/po/uk.po
index c00bf4789a..4b55b47f32 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -1167,7 +1167,7 @@ msgstr "З'єднання не є коректним: %s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "Назви інтерфейсу пристрою і з'єднання не збігаються."
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/vi.po b/po/vi.po
index e690164329..fc8470ca15 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -1101,7 +1101,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/wa.po b/po/wa.po
index 09fb498a15..e253312ba3 100644
--- a/po/wa.po
+++ b/po/wa.po
@@ -1122,7 +1122,7 @@ msgstr ""
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 6df2d6a545..3c0266d8f1 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -1108,7 +1108,7 @@ msgstr "连接无效:%s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "这个设备的接口名和连接不匹配。"
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/zh_HK.po b/po/zh_HK.po
index 510d20dbbc..99f4629d82 100644
--- a/po/zh_HK.po
+++ b/po/zh_HK.po
@@ -1154,7 +1154,7 @@ msgstr "VPN 連線‘%s’沒有設定正確。"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr ""
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 5e6cd99701..55a8b14069 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -1118,7 +1118,7 @@ msgstr "連線無效:%s"
#: ../src/libnm-client-impl/nm-device.c:2773
#, c-format
-msgid "The interface names of the device and the connection didn't match."
+msgid "The interface names of the device and the connection didn't match"
msgstr "設備的接口名稱和連接不匹配。"
#: ../src/libnm-client-impl/nm-secret-agent-old.c:1384
diff --git a/src/core/NetworkManagerUtils.c b/src/core/NetworkManagerUtils.c
index 34ddf9fb1a..32d6db6375 100644
--- a/src/core/NetworkManagerUtils.c
+++ b/src/core/NetworkManagerUtils.c
@@ -227,19 +227,23 @@ out:
/*****************************************************************************/
void
-nm_utils_complete_generic(NMPlatform * platform,
- NMConnection * connection,
- const char * ctype,
- NMConnection *const *existing_connections,
- const char * preferred_id,
- const char * fallback_id_prefix,
- const char * ifname_prefix,
- const char * ifname,
- gboolean default_enable_ipv6)
+_nm_utils_complete_generic_with_params(NMPlatform * platform,
+ NMConnection * connection,
+ const char * ctype,
+ NMConnection *const *existing_connections,
+ const char * preferred_id,
+ const char * fallback_id_prefix,
+ const char * ifname_prefix,
+ const char * ifname,
+ ...)
{
NMSettingConnection *s_con;
- char * id, *generated_ifname;
- GHashTable * parameters;
+ char * id;
+ char * generated_ifname;
+ gs_unref_hashtable GHashTable *parameters = NULL;
+ va_list ap;
+ const char * p_val;
+ const char * p_key;
g_assert(fallback_id_prefix);
g_return_if_fail(ifname_prefix == NULL || ifname == NULL);
@@ -268,7 +272,9 @@ nm_utils_complete_generic(NMPlatform * platform,
}
/* Add an interface name, if requested */
- if (ifname) {
+ if (nm_setting_connection_get_interface_name(s_con)) {
+ /* pass */
+ } else if (ifname) {
g_object_set(G_OBJECT(s_con), NM_SETTING_CONNECTION_INTERFACE_NAME, ifname, NULL);
} else if (ifname_prefix && !nm_setting_connection_get_interface_name(s_con)) {
generated_ifname = get_new_connection_ifname(platform, existing_connections, ifname_prefix);
@@ -277,13 +283,20 @@ nm_utils_complete_generic(NMPlatform * platform,
}
/* Normalize */
- parameters = g_hash_table_new(nm_str_hash, g_str_equal);
- g_hash_table_insert(parameters,
- NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD,
- default_enable_ipv6 ? NM_SETTING_IP6_CONFIG_METHOD_AUTO
- : NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
+ va_start(ap, ifname);
+ while ((p_key = va_arg(ap, const char *))) {
+ p_val = va_arg(ap, const char *);
+ if (!p_val) {
+ if (parameters)
+ g_hash_table_remove(parameters, p_key);
+ continue;
+ }
+ if (!parameters)
+ parameters = g_hash_table_new(nm_str_hash, g_str_equal);
+ g_hash_table_insert(parameters, (char *) p_key, (char *) p_val);
+ }
+ va_end(ap);
nm_connection_normalize(connection, parameters, NULL, NULL);
- g_hash_table_destroy(parameters);
}
/*****************************************************************************/
diff --git a/src/core/NetworkManagerUtils.h b/src/core/NetworkManagerUtils.h
index 1c86387c06..af5b5a5ef2 100644
--- a/src/core/NetworkManagerUtils.h
+++ b/src/core/NetworkManagerUtils.h
@@ -19,15 +19,60 @@ const char *nm_utils_get_ip_config_method(NMConnection *connection, int addr_fam
const char *nm_utils_get_shared_wifi_permission(NMConnection *connection);
-void nm_utils_complete_generic(NMPlatform * platform,
- NMConnection * connection,
- const char * ctype,
- NMConnection *const *existing_connections,
- const char * preferred_id,
- const char * fallback_id_prefix,
- const char * ifname_prefix,
- const char * ifname,
- gboolean default_enable_ipv6);
+void _nm_utils_complete_generic_with_params(NMPlatform * platform,
+ NMConnection * connection,
+ const char * ctype,
+ NMConnection *const *existing_connections,
+ const char * preferred_id,
+ const char * fallback_id_prefix,
+ const char * ifname_prefix,
+ const char * ifname,
+ ...) G_GNUC_NULL_TERMINATED;
+
+#define nm_utils_complete_generic_with_params(platform, \
+ connection, \
+ ctype, \
+ existing_connections, \
+ preferred_id, \
+ fallback_id_prefix, \
+ ifname_prefix, \
+ ifname, \
+ ...) \
+ _nm_utils_complete_generic_with_params(platform, \
+ connection, \
+ ctype, \
+ existing_connections, \
+ preferred_id, \
+ fallback_id_prefix, \
+ ifname_prefix, \
+ ifname, \
+ ##__VA_ARGS__, \
+ NULL)
+
+static inline void
+nm_utils_complete_generic(NMPlatform * platform,
+ NMConnection * connection,
+ const char * ctype,
+ NMConnection *const *existing_connections,
+ const char * preferred_id,
+ const char * fallback_id_prefix,
+ const char * ifname_prefix,
+ const char * ifname,
+ gboolean default_enable_ipv6)
+{
+ nm_utils_complete_generic_with_params(platform,
+ connection,
+ ctype,
+ existing_connections,
+ preferred_id,
+ fallback_id_prefix,
+ ifname_prefix,
+ ifname,
+ NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD,
+ default_enable_ipv6
+ ? NM_SETTING_IP6_CONFIG_METHOD_AUTO
+ : NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
+}
typedef gboolean(NMUtilsMatchFilterFunc)(NMConnection *connection, gpointer user_data);
diff --git a/src/core/devices/nm-device-dummy.c b/src/core/devices/nm-device-dummy.c
index 488f0ba003..c2b9dbab68 100644
--- a/src/core/devices/nm-device-dummy.c
+++ b/src/core/devices/nm-device-dummy.c
@@ -50,23 +50,19 @@ complete_connection(NMDevice * device,
{
NMSettingDummy *s_dummy;
- nm_utils_complete_generic(nm_device_get_platform(device),
- connection,
- NM_SETTING_DUMMY_SETTING_NAME,
- existing_connections,
- NULL,
- _("Dummy connection"),
- NULL,
- NULL,
- TRUE);
+ nm_utils_complete_generic_with_params(nm_device_get_platform(device),
+ connection,
+ NM_SETTING_DUMMY_SETTING_NAME,
+ existing_connections,
+ NULL,
+ _("Dummy connection"),
+ NULL,
+ nm_device_get_ip_iface(device));
s_dummy = nm_connection_get_setting_dummy(connection);
if (!s_dummy) {
- g_set_error_literal(error,
- NM_DEVICE_ERROR,
- NM_DEVICE_ERROR_INVALID_CONNECTION,
- "A 'dummy' setting is required.");
- return FALSE;
+ s_dummy = NM_SETTING_DUMMY(nm_setting_dummy_new());
+ nm_connection_add_setting(connection, NM_SETTING(s_dummy));
}
return TRUE;
diff --git a/src/libnm-client-impl/nm-device.c b/src/libnm-client-impl/nm-device.c
index 4d097935cb..601850d984 100644
--- a/src/libnm-client-impl/nm-device.c
+++ b/src/libnm-client-impl/nm-device.c
@@ -2770,7 +2770,7 @@ connection_compatible(NMDevice *device, NMConnection *connection, GError **error
g_set_error(error,
NM_DEVICE_ERROR,
NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
- _("The interface names of the device and the connection didn't match."));
+ _("The interface names of the device and the connection didn't match"));
return FALSE;
}
diff --git a/src/libnm-core-impl/nm-connection.c b/src/libnm-core-impl/nm-connection.c
index 4ac7b322fe..a8563cffac 100644
--- a/src/libnm-core-impl/nm-connection.c
+++ b/src/libnm-core-impl/nm-connection.c
@@ -1208,10 +1208,23 @@ _normalize_ip_config(NMConnection *self, GHashTable *parameters)
if (_supports_addr_family(self, AF_INET)) {
if (!s_ip4) {
- const char *default_ip4_method = NM_SETTING_IP4_CONFIG_METHOD_AUTO;
+ const char *default_ip4_method = NULL;
- if (nm_connection_is_type(self, NM_SETTING_WIREGUARD_SETTING_NAME))
- default_ip4_method = NM_SETTING_IP4_CONFIG_METHOD_DISABLED;
+ if (parameters) {
+ default_ip4_method =
+ g_hash_table_lookup(parameters,
+ NM_CONNECTION_NORMALIZE_PARAM_IP4_CONFIG_METHOD);
+ }
+ if (!default_ip4_method) {
+ const char *type = nm_connection_get_connection_type(self);
+
+ if (NM_IN_STRSET(type,
+ NM_SETTING_WIREGUARD_SETTING_NAME,
+ NM_SETTING_DUMMY_SETTING_NAME))
+ default_ip4_method = NM_SETTING_IP4_CONFIG_METHOD_DISABLED;
+ else
+ default_ip4_method = NM_SETTING_IP4_CONFIG_METHOD_AUTO;
+ }
/* But if no IP4 setting was specified, assume the caller was just
* being lazy and use the default method.
@@ -1255,13 +1268,18 @@ _normalize_ip_config(NMConnection *self, GHashTable *parameters)
if (!s_ip6) {
const char *default_ip6_method = NULL;
- if (parameters)
+ if (parameters) {
default_ip6_method =
g_hash_table_lookup(parameters,
NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD);
+ }
if (!default_ip6_method) {
- if (nm_connection_is_type(self, NM_SETTING_WIREGUARD_SETTING_NAME))
- default_ip6_method = NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
+ const char *type = nm_connection_get_connection_type(self);
+
+ if (NM_IN_STRSET(type,
+ NM_SETTING_WIREGUARD_SETTING_NAME,
+ NM_SETTING_DUMMY_SETTING_NAME))
+ default_ip6_method = NM_SETTING_IP6_CONFIG_METHOD_DISABLED;
else
default_ip6_method = NM_SETTING_IP6_CONFIG_METHOD_AUTO;
}
diff --git a/src/libnm-core-impl/tests/test-setting.c b/src/libnm-core-impl/tests/test-setting.c
index 6b65e98d26..58e5e1a4a7 100644
--- a/src/libnm-core-impl/tests/test-setting.c
+++ b/src/libnm-core-impl/tests/test-setting.c
@@ -874,6 +874,34 @@ test_bond_normalize(void)
/*****************************************************************************/
+static void
+test_dummy_normalize(void)
+{
+ gs_unref_object NMConnection *connection = NULL;
+ NMSettingConnection * s_con;
+
+ connection = nm_simple_connection_new();
+ s_con = NM_SETTING_CONNECTION(nm_setting_connection_new());
+ nm_connection_add_setting(connection, NM_SETTING(s_con));
+
+ g_object_set(s_con,
+ NM_SETTING_CONNECTION_ID,
+ "dummy-test",
+ NM_SETTING_CONNECTION_UUID,
+ nm_uuid_generate_random_str_a(),
+ NM_SETTING_CONNECTION_TYPE,
+ NM_SETTING_DUMMY_SETTING_NAME,
+ NULL);
+
+ nmtst_assert_connection_unnormalizable(connection, 0, 0);
+
+ g_object_set(s_con, NM_SETTING_CONNECTION_INTERFACE_NAME, "dummy1", NULL);
+
+ nmtst_connection_normalize(connection);
+}
+
+/*****************************************************************************/
+
#define DCB_FLAGS_ALL \
(NM_SETTING_DCB_FLAG_ENABLE | NM_SETTING_DCB_FLAG_ADVERTISE | NM_SETTING_DCB_FLAG_WILLING)
@@ -3619,6 +3647,12 @@ test_roundtrip_conversion(gconstpointer test_data)
s_wg = NM_SETTING_WIREGUARD(nm_connection_get_setting(con, NM_TYPE_SETTING_WIREGUARD));
+ s_ip.s_4 = NM_SETTING_IP_CONFIG(nm_connection_get_setting(con, NM_TYPE_SETTING_IP4_CONFIG));
+ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip.s_4), ==, "disabled");
+
+ s_ip.s_6 = NM_SETTING_IP_CONFIG(nm_connection_get_setting(con, NM_TYPE_SETTING_IP6_CONFIG));
+ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip.s_6), ==, "disabled");
+
g_ptr_array_add(kf_data_arr,
g_strdup_printf("[connection]\n"
"id=%s\n"
@@ -3636,7 +3670,7 @@ test_roundtrip_conversion(gconstpointer test_data)
"[ipv6]\n"
"addr-gen-mode=stable-privacy\n"
"dns-search=\n"
- "method=ignore\n"
+ "method=disabled\n"
"\n"
"[proxy]\n"
"",
@@ -3693,7 +3727,7 @@ test_roundtrip_conversion(gconstpointer test_data)
"[ipv6]\n"
"addr-gen-mode=stable-privacy\n"
"dns-search=\n"
- "method=ignore\n"
+ "method=disabled\n"
"\n"
"[proxy]\n"
"",
@@ -4741,6 +4775,8 @@ main(int argc, char **argv)
g_test_add_func("/libnm/settings/bond/compare", test_bond_compare);
g_test_add_func("/libnm/settings/bond/normalize", test_bond_normalize);
+ g_test_add_func("/libnm/settings/dummy/normalize", test_dummy_normalize);
+
g_test_add_func("/libnm/settings/dcb/flags-valid", test_dcb_flags_valid);
g_test_add_func("/libnm/settings/dcb/flags-invalid", test_dcb_flags_invalid);
g_test_add_func("/libnm/settings/dcb/app-priorities", test_dcb_app_priorities);
diff --git a/src/libnm-core-public/nm-connection.h b/src/libnm-core-public/nm-connection.h
index 44d1568d7a..fd985141a1 100644
--- a/src/libnm-core-public/nm-connection.h
+++ b/src/libnm-core-public/nm-connection.h
@@ -29,9 +29,20 @@ G_BEGIN_DECLS
#define NM_CONNECTION_CHANGED "changed"
/*
+ * NM_CONNECTION_NORMALIZE_PARAM_IP4_CONFIG_METHOD: overwrite the ip4 method
+ * when normalizing ip4 configuration. This only takes effect, if the profile
+ * has no IPv4 settings and new settings are to be added. If omitted, this
+ * defaults depends on the profile type but usually it is "auto".
+ *
+ * Since: 1.34
+ */
+#define NM_CONNECTION_NORMALIZE_PARAM_IP4_CONFIG_METHOD "ip4-config-method"
+
+/*
* NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD: overwrite the ip6 method
- * when normalizing ip6 configuration. If omitted, this defaults to
- * @NM_SETTING_IP6_CONFIG_METHOD_AUTO.
+ * when normalizing ip6 configuration. This only takes effect, if the profile
+ * has no IPv6 settings and new settings are to be added. If omitted, this
+ * defaults depends on the profile type but usually it is "auto".
*/
#define NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD "ip6-config-method"
diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c
index 9f700caed0..87cd2a8b94 100644
--- a/src/nmcli/connections.c
+++ b/src/nmcli/connections.c
@@ -201,24 +201,24 @@ nmc_active_connection_cmp(NMActiveConnection *ac_a, NMActiveConnection *ac_b)
conn = nm_active_connection_get_connection(ac_a);
s_ip = conn ? nm_connection_get_setting_ip6_config(NM_CONNECTION(conn)) : NULL;
if (s_ip
- && strcmp(nm_setting_ip_config_get_method(s_ip), NM_SETTING_IP6_CONFIG_METHOD_SHARED) == 0)
+ && nm_streq(nm_setting_ip_config_get_method(s_ip), NM_SETTING_IP6_CONFIG_METHOD_SHARED))
cmp++;
conn = nm_active_connection_get_connection(ac_b);
s_ip = conn ? nm_connection_get_setting_ip6_config(NM_CONNECTION(conn)) : NULL;
if (s_ip
- && strcmp(nm_setting_ip_config_get_method(s_ip), NM_SETTING_IP6_CONFIG_METHOD_SHARED) == 0)
+ && nm_streq(nm_setting_ip_config_get_method(s_ip), NM_SETTING_IP6_CONFIG_METHOD_SHARED))
cmp--;
NM_CMP_RETURN(cmp);
conn = nm_active_connection_get_connection(ac_a);
s_ip = conn ? nm_connection_get_setting_ip4_config(NM_CONNECTION(conn)) : NULL;
if (s_ip
- && strcmp(nm_setting_ip_config_get_method(s_ip), NM_SETTING_IP4_CONFIG_METHOD_SHARED) == 0)
+ && nm_streq(nm_setting_ip_config_get_method(s_ip), NM_SETTING_IP4_CONFIG_METHOD_SHARED))
cmp++;
conn = nm_active_connection_get_connection(ac_b);
s_ip = conn ? nm_connection_get_setting_ip4_config(NM_CONNECTION(conn)) : NULL;
if (s_ip
- && strcmp(nm_setting_ip_config_get_method(s_ip), NM_SETTING_IP4_CONFIG_METHOD_SHARED) == 0)
+ && nm_streq(nm_setting_ip_config_get_method(s_ip), NM_SETTING_IP4_CONFIG_METHOD_SHARED))
cmp--;
NM_CMP_RETURN(cmp);
@@ -2463,7 +2463,7 @@ find_device_for_connection(NmCli * nmc,
g_assert(s_con);
con_type = nm_setting_connection_get_connection_type(s_con);
- if (strcmp(con_type, NM_SETTING_VPN_SETTING_NAME) == 0) {
+ if (nm_streq(con_type, NM_SETTING_VPN_SETTING_NAME)) {
/* VPN connections */
NMActiveConnection *active = NULL;
if (iface) {
@@ -2488,8 +2488,9 @@ find_device_for_connection(NmCli * nmc,
}
} else {
/* Other connections */
- NMDevice * found_device = NULL;
- const GPtrArray *devices = nm_client_get_devices(nmc->client);
+ NMDevice * found_device = NULL;
+ const GPtrArray *devices = nm_client_get_devices(nmc->client);
+ gboolean found_device_with_name = FALSE;
for (i = 0; i < devices->len && !found_device; i++) {
NMDevice *dev = g_ptr_array_index(devices, i);
@@ -2499,6 +2500,7 @@ find_device_for_connection(NmCli * nmc,
if (!nm_streq0(dev_iface, iface))
continue;
+ found_device_with_name = TRUE;
if (!nm_device_connection_compatible(dev, connection, error)) {
g_prefix_error(error,
_("device '%s' not compatible with connection '%s': "),
@@ -2535,12 +2537,21 @@ find_device_for_connection(NmCli * nmc,
if (!found_device) {
if (iface) {
- g_set_error(error,
- NMCLI_ERROR,
- 0,
- _("device '%s' not compatible with connection '%s'"),
- iface,
- nm_setting_connection_get_id(s_con));
+ if (found_device_with_name) {
+ g_set_error(error,
+ NMCLI_ERROR,
+ 0,
+ _("device '%s' not compatible with connection '%s'"),
+ iface,
+ nm_setting_connection_get_id(s_con));
+ } else {
+ g_set_error(error,
+ NMCLI_ERROR,
+ 0,
+ _("device '%s' not found for connection '%s'"),
+ iface,
+ nm_setting_connection_get_id(s_con));
+ }
} else {
g_set_error(error,
NMCLI_ERROR,
@@ -2833,8 +2844,7 @@ nmc_activate_connection(NmCli * nmc,
&spec_object,
&local);
- /* Virtual connection may not have their interfaces created yet */
- if (!device_found && !nm_connection_is_virtual(connection)) {
+ if (!device_found) {
g_set_error(error, NMCLI_ERROR, NMC_RESULT_ERROR_CON_ACTIVATION, "%s", local->message);
return FALSE;
}
@@ -2947,7 +2957,7 @@ do_connection_up(const NMCCommand *cmd, NmCli *nmc, int argc, const char *const
argc_ptr = &arg_num;
}
- if (argc > 0 && strcmp(*argv, "ifname") != 0) {
+ if (argc > 0 && !nm_streq(*argv, "ifname")) {
connection = get_connection(nmc, argc_ptr, argv_ptr, NULL, NULL, NULL, &error);
if (!connection) {
g_string_printf(nmc->return_text, _("Error: %s."), error->message);
@@ -2960,7 +2970,7 @@ do_connection_up(const NMCCommand *cmd, NmCli *nmc, int argc, const char *const
if (argc == 1 && nmc->complete)
nmc_complete_strings(*argv, "ifname", "ap", "passwd-file");
- if (strcmp(*argv, "ifname") == 0) {
+ if (nm_streq(*argv, "ifname")) {
argc--;
argv++;
if (!argc) {
@@ -2972,7 +2982,7 @@ do_connection_up(const NMCCommand *cmd, NmCli *nmc, int argc, const char *const
ifname = *argv;
if (argc == 1 && nmc->complete)
nmc_complete_device(nmc->client, ifname, ap != NULL);
- } else if (strcmp(*argv, "ap") == 0) {
+ } else if (nm_streq(*argv, "ap")) {
argc--;
argv++;
if (!argc) {
@@ -2984,7 +2994,7 @@ do_connection_up(const NMCCommand *cmd, NmCli *nmc, int argc, const char *const
ap = *argv;
if (argc == 1 && nmc->complete)
nmc_complete_bssid(nmc->client, ifname, ap);
- } else if (strcmp(*argv, "passwd-file") == 0) {
+ } else if (nm_streq(*argv, "passwd-file")) {
argc--;
argv++;
if (!argc) {
@@ -3652,7 +3662,7 @@ is_setting_mandatory(NMConnection *connection, NMSetting *setting)
else
item = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL);
for (; item && *item; item++) {
- if (!strcmp(name, (*item)->setting_info->general->setting_name))
+ if (nm_streq(name, (*item)->setting_info->general->setting_name))
return (*item)->mandatory;
}
}
@@ -3721,11 +3731,11 @@ normalized_master_for_slave(const GPtrArray *connections,
s_con = nm_connection_get_setting_connection(connection);
g_assert(s_con);
con_type = nm_setting_connection_get_connection_type(s_con);
- if (type && g_strcmp0(con_type, type) != 0)
+ if (type && !nm_streq0(con_type, type))
continue;
if (func) {
/* There was a prefix; only compare to that type. */
- if (g_strcmp0(master, func(connection)) == 0) {
+ if (nm_streq0(master, func(connection))) {
if (out_type)
*out_type = con_type;
if (func == nm_connection_get_id)
@@ -3738,13 +3748,13 @@ normalized_master_for_slave(const GPtrArray *connections,
id = nm_connection_get_id(connection);
uuid = nm_connection_get_uuid(connection);
ifname = nm_connection_get_interface_name(connection);
- if (g_strcmp0(master, uuid) == 0 || g_strcmp0(master, ifname) == 0) {
+ if (NM_IN_STRSET(master, uuid, ifname)) {
out_master = master;
if (out_type)
*out_type = con_type;
break;
}
- if (!found_by_id && g_strcmp0(master, id) == 0) {
+ if (!found_by_id && nm_streq0(master, id)) {
out_type_by_id = con_type;
found_by_id = uuid;
}
@@ -4352,10 +4362,11 @@ set_connection_type(NmCli * nmc,
}
/* ifname is mandatory for all connection types except virtual ones (bond, team, bridge, vlan) */
- if ((strcmp(value, NM_SETTING_BOND_SETTING_NAME) == 0)
- || (strcmp(value, NM_SETTING_TEAM_SETTING_NAME) == 0)
- || (strcmp(value, NM_SETTING_BRIDGE_SETTING_NAME) == 0)
- || (strcmp(value, NM_SETTING_VLAN_SETTING_NAME) == 0)) {
+ if (NM_IN_STRSET(value,
+ NM_SETTING_BOND_SETTING_NAME,
+ NM_SETTING_TEAM_SETTING_NAME,
+ NM_SETTING_BRIDGE_SETTING_NAME,
+ NM_SETTING_VLAN_SETTING_NAME)) {
disable_options(NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_INTERFACE_NAME);
}
@@ -4386,7 +4397,7 @@ set_connection_iface(NmCli * nmc,
{
if (value) {
/* Special value of '*' means no specific interface name */
- if (strcmp(value, "*") == 0)
+ if (nm_streq(value, "*"))
value = NULL;
}
@@ -4541,19 +4552,17 @@ set_bluetooth_type(NmCli * nmc,
return TRUE;
/* 'dun' type requires adding 'gsm' or 'cdma' setting */
- if (!strcmp(value, NM_SETTING_BLUETOOTH_TYPE_DUN)
- || !strcmp(value, NM_SETTING_BLUETOOTH_TYPE_DUN "-gsm")) {
+ if (NM_IN_STRSET(value, NM_SETTING_BLUETOOTH_TYPE_DUN, NM_SETTING_BLUETOOTH_TYPE_DUN "-gsm")) {
value = NM_SETTING_BLUETOOTH_TYPE_DUN;
setting = nm_meta_setting_info_editor_new_setting(
&nm_meta_setting_infos_editor[NM_META_SETTING_TYPE_GSM],
NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI);
nm_connection_add_setting(con, setting);
- } else if (!strcmp(value, NM_SETTING_BLUETOOTH_TYPE_DUN "-cdma")) {
+ } else if (NM_IN_STRSET(value, NM_SETTING_BLUETOOTH_TYPE_DUN "-cdma")) {
value = NM_SETTING_BLUETOOTH_TYPE_DUN;
setting = nm_setting_cdma_new();
nm_connection_add_setting(con, setting);
- } else if (!strcmp(value, NM_SETTING_BLUETOOTH_TYPE_PANU)
- || !strcmp(value, NM_SETTING_BLUETOOTH_TYPE_NAP)) {
+ } else if (NM_IN_STRSET(value, NM_SETTING_BLUETOOTH_TYPE_PANU, NM_SETTING_BLUETOOTH_TYPE_NAP)) {
/* no op */
} else {
g_set_error(error,
@@ -5605,13 +5614,13 @@ read_properties:
g_clear_error(&error);
/* Get the arguments from the command line if any */
if (argc && !nmc_process_connection_properties(nmc, connection, &argc, &argv, FALSE, &error)) {
- if (g_strcmp0(*argv, "--") == 0 && !seen_dash_dash) {
+ if (nm_streq0(*argv, "--") && !seen_dash_dash) {
/* This is for compatibility with older nmcli that required
* options and properties to be separated with "--" */
seen_dash_dash = TRUE;
next_arg(nmc, &argc, &argv, NULL);
goto read_properties;
- } else if (g_strcmp0(*argv, "save") == 0) {
+ } else if (nm_streq0(*argv, "save")) {
/* It would be better if "save" was a separate argument and not
* mixed with properties, but there's not much we can do about it now. */
argc--;
@@ -6071,7 +6080,7 @@ _create_vpn_array(const GPtrArray *connections, gboolean uuid)
NMConnection *connection = NM_CONNECTION(connections->pdata[c]);
const char * type = nm_connection_get_connection_type(connection);
- if (g_strcmp0(type, NM_SETTING_VPN_SETTING_NAME) == 0)
+ if (nm_streq0(type, NM_SETTING_VPN_SETTING_NAME))
array[idx++] =
uuid ? nm_connection_get_uuid(connection) : nm_connection_get_id(connection);
}
@@ -6479,11 +6488,11 @@ nmcli_editor_tab_completion(const char *text, int start, int end)
n1 = strspn(line, " \t");
/* Choose the right generator function */
- if (strcmp(prompt_tmp, EDITOR_PROMPT_CON_TYPE) == 0)
+ if (nm_streq(prompt_tmp, EDITOR_PROMPT_CON_TYPE))
generator_func = gen_connection_types(text);
- else if (strcmp(prompt_tmp, EDITOR_PROMPT_SETTING) == 0)
+ else if (nm_streq(prompt_tmp, EDITOR_PROMPT_SETTING))
generator_func = gen_setting_names;
- else if (strcmp(prompt_tmp, EDITOR_PROMPT_PROPERTY) == 0)
+ else if (nm_streq(prompt_tmp, EDITOR_PROMPT_PROPERTY))
generator_func = gen_property_names;
else if (g_str_has_suffix(rl_prompt, prompt_yes_no(TRUE, NULL))
|| g_str_has_suffix(rl_prompt, prompt_yes_no(FALSE, NULL)))
@@ -6759,7 +6768,7 @@ parse_editor_main_cmd(const char *cmd, char **cmd_arg)
editor_cmd = NMC_EDITOR_MAIN_CMD_ACTIVATE;
else if (matches(cmd_arg0, "back"))
editor_cmd = NMC_EDITOR_MAIN_CMD_BACK;
- else if (matches(cmd_arg0, "help") || strcmp(cmd_arg0, "?") == 0)
+ else if (matches(cmd_arg0, "help") || nm_streq(cmd_arg0, "?"))
editor_cmd = NMC_EDITOR_MAIN_CMD_HELP;
else if (matches(cmd_arg0, "quit"))
editor_cmd = NMC_EDITOR_MAIN_CMD_QUIT;
@@ -6946,7 +6955,7 @@ parse_editor_sub_cmd(const char *cmd, char **cmd_arg)
editor_cmd = NMC_EDITOR_SUB_CMD_PRINT;
else if (matches(cmd_arg0, "back"))
editor_cmd = NMC_EDITOR_SUB_CMD_BACK;
- else if (matches(cmd_arg0, "help") || strcmp(cmd_arg0, "?") == 0)
+ else if (matches(cmd_arg0, "help") || nm_streq(cmd_arg0, "?"))
editor_cmd = NMC_EDITOR_SUB_CMD_HELP;
else if (matches(cmd_arg0, "quit"))
editor_cmd = NMC_EDITOR_SUB_CMD_QUIT;
@@ -8161,12 +8170,12 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty
case NMC_EDITOR_MAIN_CMD_VERIFY:
/* Verify current setting or the whole connection */
- if (cmd_arg && strcmp(cmd_arg, "all") && strcmp(cmd_arg, "fix")) {
+ if (cmd_arg && !nm_streq(cmd_arg, "all") && !nm_streq(cmd_arg, "fix")) {
g_print(_("Invalid verify option: %s\n"), cmd_arg);
break;
}
- if (menu_ctx.curr_setting && (!cmd_arg || strcmp(cmd_arg, "all") != 0)) {
+ if (menu_ctx.curr_setting && (!cmd_arg || !nm_streq(cmd_arg, "all"))) {
gs_free_error GError *tmp_err = NULL;
nm_setting_verify(menu_ctx.curr_setting, NULL, &tmp_err);
@@ -8524,7 +8533,7 @@ editor_init_new_connection(NmCli *nmc, NMConnection *connection, const char *sla
set_default_interface_name(nmc, s_con);
/* Set sensible initial VLAN values */
- if (g_strcmp0(con_type, NM_SETTING_VLAN_SETTING_NAME) == 0) {
+ if (nm_streq0(con_type, NM_SETTING_VLAN_SETTING_NAME)) {
const char *dev_ifname = get_ethernet_device_name(nmc);
g_object_set(NM_SETTING_VLAN(base_setting),
@@ -9311,7 +9320,7 @@ do_connection_import(const NMCCommand *cmd, NmCli *nmc, int argc, const char *co
nmc_complete_strings(*argv, type ? NULL : "type", filename ? NULL : "file");
}
- if (strcmp(*argv, "type") == 0) {
+ if (nm_streq(*argv, "type")) {
argc--;
argv++;
if (!argc) {
@@ -9333,7 +9342,7 @@ do_connection_import(const NMCCommand *cmd, NmCli *nmc, int argc, const char *co
else
g_printerr(_("Warning: 'type' already specified, ignoring extra one.\n"));
- } else if (strcmp(*argv, "file") == 0) {
+ } else if (nm_streq(*argv, "file")) {
argc--;
argv++;
if (!argc) {
@@ -9465,7 +9474,7 @@ do_connection_export(const NMCCommand *cmd, NmCli *nmc, int argc, const char *co
}
type = nm_connection_get_connection_type(connection);
- if (g_strcmp0(type, NM_SETTING_VPN_SETTING_NAME) != 0) {
+ if (!nm_streq0(type, NM_SETTING_VPN_SETTING_NAME)) {
g_string_printf(nmc->return_text, _("Error: the connection is not VPN."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
@@ -9587,7 +9596,7 @@ nmcli_con_tab_completion(const char *text, int start, int end)
/* Disable readline's default filename completion */
rl_attempted_completion_over = 1;
- if (g_strcmp0(rl_prompt, PROMPT_CONNECTION) == 0) {
+ if (nm_streq0(rl_prompt, PROMPT_CONNECTION)) {
/* Disable appending space after completion */
rl_completion_append_character = '\0';
@@ -9595,18 +9604,18 @@ nmcli_con_tab_completion(const char *text, int start, int end)
return NULL;
generator_func = gen_func_connection_names;
- } else if (g_strcmp0(rl_prompt, PROMPT_CONNECTIONS) == 0) {
+ } else if (nm_streq0(rl_prompt, PROMPT_CONNECTIONS)) {
generator_func = gen_func_connection_names;
- } else if (g_strcmp0(rl_prompt, PROMPT_ACTIVE_CONNECTIONS) == 0) {
+ } else if (nm_streq0(rl_prompt, PROMPT_ACTIVE_CONNECTIONS)) {
generator_func = gen_func_active_connection_names;
} else if (rl_prompt && g_str_has_prefix(rl_prompt, NM_META_TEXT_PROMPT_VPN_TYPE)) {
info = (const NMMetaAbstractInfo *) nm_meta_property_info_vpn_service_type;
nmc_tab_completion.words = _meta_abstract_complete(info, text);
generator_func = _meta_abstract_generator;
- } else if (g_strcmp0(rl_prompt, PROMPT_IMPORT_FILE) == 0) {
+ } else if (nm_streq0(rl_prompt, PROMPT_IMPORT_FILE)) {
rl_attempted_completion_over = 0;
rl_complete_with_tilde_expansion = 1;
- } else if (g_strcmp0(rl_prompt, PROMPT_VPN_CONNECTION) == 0) {
+ } else if (nm_streq0(rl_prompt, PROMPT_VPN_CONNECTION)) {
generator_func = gen_vpn_ids;
}