Comment 0 for bug 1186273

Revision history for this message
Ritesh Khadgaray (khadgaray) wrote : DUN via bluetooth fails

DUN via bluetooth fails

from

$ cat /etc/NetworkManager/system-connection/example
[connection]
id=Mobil-BT connection
uuid=c57749ea-92fb-4297-8db4-875b66b3319a
type=bluetooth
autoconnect=false

[bluetooth]
bdaddr=00:16:4E:24:EA:2F
type=dun

[gsm]
number=*99#
apn=apn.example.com
username=userexample
password=secret
pin=1234

[serial]
baud=115200

--------------------------------

 351
 352 static gboolean
 353 extract_details_from_connection (NMConnection *connection,
 354 const char **username,
 355 const char **password,
 356 GError **error)
 357 {

...
 372 setting = nm_connection_get_setting_by_name (connection, connection_type);
 373
// We need to add this section as we do not check for bluetooth ( which can hold either gsm or cdma settings

 374 if (NM_IS_SETTING_BLUETOOTH(setting)) {
 375 /* wrong connection type, try to get gsm connection settings */
 376 setting = nm_connection_get_setting_by_name(connection, NM_SETTING_GSM_SETTING_NAME);
 377 if (!setting) {
 378 setting = nm_connection_get_setting_by_name(connection, NM_SETTING_CDMA_SETTING_NAME);
 379 }
 380 }
 381
 382 if (!setting) {
 383 g_set_error_literal (error, NM_PPP_MANAGER_ERROR, NM_PPP_MANAGER_ERROR_UNKOWN,
 384 "Missing type-specific setting; no secrets could be found.");
 385 return FALSE;
 386 }
 387

// regular code
...
 395 } else if (NM_IS_SETTING_GSM (setting)) {
 396 *username = nm_setting_gsm_get_username (NM_SETTING_GSM (setting));
 397 *password = nm_setting_gsm_get_password (NM_SETTING_GSM (setting));
 398 } else if (NM_IS_SETTING_CDMA (setting)) {
 399 *username = nm_setting_cdma_get_username (NM_SETTING_CDMA (setting));
 400 *password = nm_setting_cdma_get_password (NM_SETTING_CDMA (setting));