summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-01-13release: bump version to 1.12.41.12.4Aleksander Morgado1-1/+1
2020-01-13NEWS: update for 1.12.4Aleksander Morgado1-0/+53
2020-01-10iface-modem-location: fix big memleak when processing location updatesAleksander Morgado1-3/+18
The GVariants that we obtain during the processing of the "previous" dictionary with g_variant_iter_next() are full references, while the GVariants that we obtain processing the input MMLocationXX objects are floating references. The code was working well with the floating references only, as it was assumed that g_variant_builder_add() would take ownership of them as full references; but when the GVariant came from the g_variant_iter_next() processing, g_variant_builder_add() would take a full new extra reference, triggering the memory leak. Fix this, by making sure that we always work with full GVariant references in all cases, converting the floating ones with g_variant_ref_sink() and making sure we explicitly unref them after g_variant_builder_add(). ==3146== 112 (48 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 4,532 of 4,887 ==3146== at 0x483877F: malloc (vg_replace_malloc.c:309) ==3146== by 0x50D53DA: g_malloc (gmem.c:99) ==3146== by 0x50F19ED: g_slice_alloc (gslice.c:1024) ==3146== by 0x511D639: g_variant_alloc (gvariant-core.c:486) ==3146== by 0x511D6F9: g_variant_new_from_bytes (gvariant-core.c:529) ==3146== by 0x51146C3: g_variant_new_from_trusted (gvariant.c:326) ==3146== by 0x5115D28: g_variant_new_string (gvariant.c:1264) ==3146== by 0x48EC642: mm_location_3gpp_get_string_variant (mm-location-3gpp.c:294) ==3146== by 0x196350: build_location_dictionary (mm-iface-modem-location.c:162) ==3146== by 0x197E0C: handle_setup_auth_ready (mm-iface-modem-location.c:891) ==3146== by 0x4EC9160: g_task_return_now (gtask.c:1212) ==3146== by 0x4EC92AA: g_task_return (gtask.c:1281) ==3146== 41,658 (35,520 direct, 6,138 indirect) bytes in 740 blocks are definitely lost in loss record 4,887 of 4,887 ==3146== at 0x483877F: malloc (vg_replace_malloc.c:309) ==3146== by 0x50D53DA: g_malloc (gmem.c:99) ==3146== by 0x50F19ED: g_slice_alloc (gslice.c:1024) ==3146== by 0x511E02B: g_variant_get_child_value (gvariant-core.c:1093) ==3146== by 0x5114FA7: g_variant_get_variant (gvariant.c:748) ==3146== by 0x511B196: g_variant_valist_get_nnp (gvariant.c:4934) ==3146== by 0x511B87B: g_variant_valist_get_leaf (gvariant.c:5051) ==3146== by 0x511BFBF: g_variant_valist_get (gvariant.c:5232) ==3146== by 0x511C145: g_variant_valist_get (gvariant.c:5267) ==3146== by 0x511C953: g_variant_iter_next (gvariant.c:5667) ==3146== by 0x1962F5: build_location_dictionary (mm-iface-modem-location.c:128) ==3146== by 0x19659A: notify_gps_location_update (mm-iface-modem-location.c:231) (cherry picked from commit 246fe710b728c7d2637b8a30b7db1901a79fca58)
2020-01-10iface-modem-location: fix very very unlikely memory leakAleksander Morgado1-0/+1
(cherry picked from commit 7c66b608c977413ffae6b6900c1c1e4033f07214)
2020-01-10bearer-qmi: simplify dispose() just by reseting connection dataAleksander Morgado1-31/+3
(cherry picked from commit 33b1962615febea5c34f0fbddc24eab8de5a9c7a)
2020-01-10bearer-qmi: plug memleak when disposing connected bearerAleksander Morgado1-0/+5
Also, explicitly close the QMI port if we had it open for the connected bearer. ==991919== 6,533 (48 direct, 6,485 indirect) bytes in 1 blocks are definitely lost in loss record 5,171 of 5,177 ==991919== at 0x5048291: g_type_create_instance (gtype.c:1844) ==991919== by 0x502DFC4: g_object_new_internal (gobject.c:1827) ==991919== by 0x502EFA9: g_object_new_valist (gobject.c:2152) ==991919== by 0x502DB9E: g_object_new (gobject.c:1670) ==991919== by 0x2215CA: mm_port_qmi_new (mm-port-qmi.c:615) ==991919== by 0x16C892: mm_base_modem_grab_port (mm-base-modem.c:295) ==991919== by 0x1CEEE5: mm_plugin_create_modem (mm-plugin.c:1048) ==991919== by 0x157E1E: mm_device_create_modem (mm-device.c:413) ==991919== by 0x1535A0: device_support_check_ready (mm-base-manager.c:195) ==991919== by 0x4EC9160: g_task_return_now (gtask.c:1212) ==991919== by 0x4EC92AA: g_task_return (gtask.c:1281) ==991919== by 0x4EC9E34: g_task_return_pointer (gtask.c:1689) (cherry picked from commit 29e64f59af44a23d929107fb4896d10f44b4dfd7)
2020-01-10broadband-modem-qmi: plug memleak when checking unlock status with DMS UIMAleksander Morgado1-0/+1
==990910== 28 bytes in 1 blocks are definitely lost in loss record 1,943 of 5,051 ==990910== at 0x483877F: malloc (vg_replace_malloc.c:309) ==990910== by 0x50D53DA: g_malloc (gmem.c:99) ==990910== by 0x50F19ED: g_slice_alloc (gslice.c:1024) ==990910== by 0x50F1A2D: g_slice_alloc0 (gslice.c:1050) ==990910== by 0x4A3FD4A: __qmi_message_dms_uim_get_pin_status_response_parse (qmi-dms.c:8212) ==990910== by 0x4A6AFEA: uim_get_pin_status_ready (qmi-dms.c:31662) ==990910== by 0x4EADC8B: g_simple_async_result_complete (gsimpleasyncresult.c:802) ==990910== by 0x4EADCBF: complete_in_idle_cb.lto_priv.0 (gsimpleasyncresult.c:814) ==990910== by 0x50CF4AE: g_idle_dispatch (gmain.c:5617) ==990910== by 0x50CC6F0: g_main_dispatch (gmain.c:3179) ==990910== by 0x50CD616: g_main_context_dispatch (gmain.c:3844) ==990910== by 0x50CD81B: g_main_context_iterate (gmain.c:3917) (cherry picked from commit e3e837a8a777a3c4404f8d598eb68c7467f53b19)
2020-01-06libmm-glib,common-helpers: allow yes/no as booleans in stringAleksander Morgado1-2/+2
E.g. so that the settings passed on Simple.Connect() or Bearer.Connect() are parsed correctly from the user string: daemon.notice netifd: wan (30476): simple connect=apn=internet,ip-type=ipv4,allow-roaming=yes daemon.notice netifd: wan (30476): Error parsing connect string: 'Invalid properties string, unexpected key 'allow-roaming'' This also goes inline with e.g. the --create-bearer help in the man page that suggests using yes/no for the allow-roaming setting. (cherry picked from commit 15e8a78a15e458efae781d4905134e07043aad25)
2020-01-03iface-modem-voice: fix segfault when voice support check failsAleksander Morgado1-2/+4
The error returned in support_check_finish() should be treated as optional, as in all the other optional feature interfaces. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/172 (cherry picked from commit 0d8a5e2a43e6baff0c282a3d2b15d03063c48199)
2019-12-31port-serial: un-schedule flash operation as soon as it's cancelledAleksander Morgado1-4/+14
When a flash operation is started, it is always scheduled in an idle. If this operation is cancelled, we should right away un-schedule it, otherwise we may end up calling flash_do() with the GTask in the private info already gone. See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_requests/178#note_330017 (cherry picked from commit 21e5b1d68336ec5a19f71e36c035e19d29623ca2)
2019-12-21iface-modem-simple: clear ongoing connect cancellable on early errorsAleksander Morgado1-11/+20
If the Simple.Connect() operation fails before the bearer connection process starts (e.g. during the previous SIM-PIN checks or explicit registration attempt), the ongoing connect cancellable is not being properly cleared, and this would prevent additional new connection attempts unless an explicit Simple.Disconnect() is called. $ sudo mmcli -m 1 --simple-connect="operator-id=21403,apn=internet" error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.MobileEquipment.NetworkTimeout: Network timeout' $ sudo mmcli -m 1 --simple-connect="operator-id=21403,apn=internet" error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.InProgress: Connection request forbidden: operation already in progress' $ sudo mmcli -m 1 --simple-connect="operator-id=21403,apn=internet" error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.InProgress: Connection request forbidden: operation already in progress' Fix this, by making sure the ongoing connect cancellable is always cleared when completing the DBus method invocation that created it. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/169 (cherry picked from commit 7a398214f9a4d85399d082634d08b2f47a8b7778)
2019-12-17base-bearer: avoid conncheck or stats update while disconnectingAleksander Morgado1-12/+18
We don't want the connection status checks to interfere with the disconnection logic, e.g. if they're both using the same TTY for both things. E.g. the CGACT? from the conncheck gets in the way of the disconnection logic: <debug> [1576037519.710684] Flashing data port (ttyUSB1)... <debug> [1576037519.710740] (ttyUSB1): port attributes not fully set <debug> [1576037520.287636] (ttyUSB1) device open count is 3 (open) <debug> [1576037520.287804] (ttyUSB1): --> 'AT+CGACT?<CR>' <debug> [1576037520.711067] (ttyUSB1) device open count is 2 (close) <debug> [1576037520.711127] (ttyUSB1): running init sequence... <debug> [1576037520.711231] PDP disconnection already sent <debug> [1576037520.711263] Disconnected bearer '/org/freedesktop/ModemManager1/Bearer/0' Instead, fully skip all conncheck and stat updates as long as the modem is not connected. The actual conncheck and stat update timeouts will be removed once completely disconnected, as it was before. (cherry picked from commit ab007960092f5c494a790ce496d15858a236bb58)
2019-12-17core,tests: new test to make sure all error codes are supportedAleksander Morgado3-0/+88
Defining the new error codes in the headers is not enough, we also need to add support in the error helpers in order to create proper GErrors with the expected error codes. (cherry picked from commit d83c018f9825d4244cc4254ff729e64172afbc2e)
2019-12-17core,error-helpers: add missing ME error codesAleksander Morgado1-49/+83
(cherry picked from commit 9991f2906fcaeb7c86740f3d0d19c82dc0ac86f9)
2019-12-17ublox: ignore error when disconnecting last LTE bearerAleksander Morgado1-4/+28
This is required in the TOBY-L2 and TOBY-L4 modules in order to report a proper disconnection, even if there is none in reality. The default LTE bearer is always reported connected while registered in LTE. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/166 (cherry picked from commit 7d1e949137bf5d7d354f8d4508f876b2a07312fc)
2019-12-17include,errors: define +CME ERROR code 151 equal to 171Aleksander Morgado1-0/+2
When the MT detects an attempt to disconnect the last PDN or when the network returns a response message with cause value #49, the "Last PDN disconnection not allowed" error is returned. The numeric error code was changed from 151 to 171 in 3GPP Rel-11, and therefore there are devices out there that would conform to Rel-10 or below and that would report +CME ERROR code 151 instead of 171. Given that 151 isn't defined to a different meaning in the specs, let's define it in the same way as 171. (cherry picked from commit f157d02fc668777ccd7de559c6e1b8400c102412)
2019-12-16libmm-glib,3gpp: make MMModem3gppNetwork a boxed typeAleksander Morgado4-5/+31
So that bindings know how to free the list of structs. This commit ends up triggering an API break in the bindings generated via GObject introspection, because the methods to access the items of a MMModem3gppNetwork are no longer treated as Modem3gpp class methods. E.g. instead of: ModemManager.Modem3gpp.network_get_operator_code(network) We should now do: network.get_operator_code() There is no API break in libmm-glib. (cherry picked from commit fcbffbd1231052fb3ea543382b59ad195cc45211)
2019-12-16examples: new network-scan-python exampleAleksander Morgado5-1/+79
This is currently not working completely ok because python doesn't know how to free the GList of MMModem3gppNetwork elements. /org/freedesktop/ModemManager1/Modem/1: starting network scan... 21403: Orange - Orange (unknown, forbidden) 21401: vodafone ES - vodafone ES (unknown, forbidden) 21403: Orange - Orange (unknown, forbidden) 21403: Orange - Orange (unknown, forbidden) 21401: vodafone ES - vodafone ES (unknown, forbidden) 21404: Yoigo - Yoigo (unknown, forbidden) 21401: vodafone ES - vodafone ES (unknown, forbidden) 21404: Yoigo - Yoigo (unknown, forbidden) 21407: Movistar - Movistar (unknown, available) 21407: Movistar - Movistar (unknown, available) 21407: Movistar - Movistar (unknown, current) free(): invalid pointer Aborted (cherry picked from commit 248cd55f0e5d2a125569f9e7974a43d6b895d6de)
2019-12-12Revert "build: fix order of linked libs in test apps"Aleksander Morgado1-2/+2
This reverts commit 3eb623e73b546a444c1fc717f4ed105b3b2d5eae. This change is plain wrong. The correct order was already fixed in commit 42dab8e8. (cherry picked from commit f9e26fb54b96921fcb5f3cc7647ba4c4ff14085f)
2019-12-12build: fix order of linked libs in test appsAleksander Morgado1-2/+2
Solving build issues with truly strict linkers, as in: http://lists.busybox.net/pipermail/buildroot/2019-December/268817.html (cherry picked from commit 3eb623e73b546a444c1fc717f4ed105b3b2d5eae)
2019-12-10build: post-release version bump to 1.12.3Aleksander Morgado1-1/+1
2019-12-10release: bump version to 1.12.21.12.2Aleksander Morgado1-1/+1
2019-12-10NEWS: update for 1.12.2Aleksander Morgado1-0/+46
2019-12-03bearer-qmi: current settings are mandatory when using 'static' addressingAleksander Morgado1-5/+24
If for any reason getting current settings fails and we require static IP addressing (when using raw-ip), then that must be a hard error, otherwise we'll end up with the modem reported as connected but without any IP settings to use: <info> error: couldn't get current settings: QMI protocol error (15): 'OutOfCall' <info> Modem /org/freedesktop/ModemManager1/Modem/0: state changed (registered -> connected) <info> Simple connect state (8/8): All done <warn> Reloading stats failed: Couldn't get packet statistics: QMI protocol error (15): 'OutOfCall' # mmcli -b 0 Bearer '/org/freedesktop/ModemManager1/Bearer/0' ------------------------- Status | connected: 'yes' | suspended: 'no' | interface: 'wwan1' | IP timeout: '20' ------------------------- Properties | apn: 'm2minternet' | roaming: 'allowed' | IP type: 'none' | user: 'none' | password: 'none' | number: 'none' | Rm protocol: 'unknown' ------------------------- IPv4 configuration | method: 'unknown' ------------------------- IPv6 configuration | method: 'unknown' ------------------------- Stats | Duration: '0' | Bytes received: 'N/A' | Bytes transmitted: 'N/A' # mmcli -m 0 /org/freedesktop/ModemManager1/Modem/0 (device id '48f6c35f3d0376aa261a91c0cf7e6340d5a91601') ... Status | lock: 'sim-pin2' | unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)' | state: 'connected' | power state: 'on' | access tech: 'lte' | signal quality: '96' (recent) (cherry picked from commit 03e6375a95ace2c1c1ecd8b621fc90b7e86ebe8b)
2019-12-03bearer: avoid reporting disconnection error if already disconnectedAleksander Morgado3-38/+23
When we try to disconnect a bearer and the bearer is already disconnected (e.g. after a cancelled connection attempt), avoid reporting that as an error: <warn> [1575287560.433398] Error disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0': 'Couldn't disconnect QMI bearer: this bearer is not connected'. Will assume disconnected anyway. (cherry picked from commit 76cafbb603599a9f19592daca50e00c6e960998e)
2019-12-03bearer-qmi: handle disconnection indications during connection attemptsAleksander Morgado1-22/+75
If a WDS indication is received telling us that the modem is no longer connected, abort the ongoing connection attempt right away with an error and cleanup all allocated clients (implicitly disconnecting them if required).. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/155 (cherry picked from commit 991e615736c1b467d7ab7041f0475297e6ef86d2)
2019-12-03bearer-qmi: common complete method for the connection attemptAleksander Morgado1-55/+76
Refactor the logic and setup a common complete_connect() method that helps us complete the GTask associated to the connection attempt. (cherry picked from commit ae53b0458bd5ca110c04aef42069e9e7b4cd2af5)
2019-12-03bearer-qmi: close QMI port if it was open during connectionAleksander Morgado1-4/+33
If the bearer is using a QMI port that is not the primary one, we need to explicitly open it during the connection attempt. Keep track of that, and make sure we close it during normal disconnection or if the connection attempt fails. (cherry picked from commit 2790074c7e00b94f5079ba7bda8911a12ab0e28c)
2019-12-03huawei: avoid using the QCDM port during a voice callAleksander Morgado1-1/+51
(cherry picked from commit f7418da3bc26dbbd03a3961f48462e8577fc944e)
2019-12-03mmcli,output: skip printing empty value listsAleksander Morgado1-1/+1
E.g. we shouldn't print emergency numbers field if there is none available: $ mmcli -i 0 ------------------------------- General | dbus path: /org/freedesktop/ModemManager1/SIM/0 ------------------------------- Properties | imsi: 901700000026890 | iccid: 8988211000000268907 | operator id: 90170 | operator name: 901 70 | emergency numbers: (cherry picked from commit 9e785e145f4f48907bee9d350aae2961037b3a23)
2019-11-28iface-modem-voice: plug task memleaks when returning error if cancelledAleksander Morgado1-2/+6
(cherry picked from commit 9ef658f697c53f51df220378de0efa14968588ff)
2019-11-28broadband-modem-mbim: plug task leak when completing USSD operationAleksander Morgado1-0/+1
(cherry picked from commit dc3bd91b53abbe9b9592812a8e6935016204a903)
2019-11-27bearer-qmi: plug memleaks when connection attempt fails earlyAleksander Morgado1-17/+15
The data and qmi objects were not being correctly disposed on several error conditions. (cherry picked from commit c523d5bdc31946f4106976c4f38f34b8f61690d7)
2019-11-27broadband-modem-mbim: avoid LTE attach config/status if unsupportedAleksander Morgado1-12/+37
If we know that the LTE attach status/configuration CIDs in the Basic Connect Extensions service are unsupported, don't even try to use them, so that we avoid timeouts in the requests. (cherry picked from commit 8f21f40674d7b33b58762fff2e7a8487d6b7efbd)
2019-11-27po: update Brazilian Portuguese translationRafael Fontenelle1-10/+9
(cherry picked from commit 95dd8aaf9043a70bc7fb84c01b57af2d7578666b)
2019-11-27telit: setup as loadable 'shared' utilsAleksander Morgado2-90/+114
(cherry picked from commit 1d1f597b5534d01d2df61a1543ed549ac9a3621b)
2019-11-27xmm: setup as loadable 'shared' utilsAleksander Morgado2-7/+27
(cherry picked from commit fce7892058dbe027089ec03909eab739e00af03e)
2019-11-27novatel: setup as loadable 'shared' utilsAleksander Morgado2-5/+25
(cherry picked from commit b765e88e5718ddaad968fb079bcc98f55808a353)
2019-11-27option: setup as loadable 'shared' utilsAleksander Morgado2-5/+25
(cherry picked from commit 2d779b97c4b7c79fff00f17d25b0c210de384f00)
2019-11-27sierra: setup as loadable 'shared' utilsAleksander Morgado2-6/+26
(cherry picked from commit 23df25f25c2bb1fb6c4867152141219151bd1942)
2019-11-27mbm: skip setting up as common utils libraryAleksander Morgado1-43/+27
The Ericsson MBM modem management is only used by the MBM plugin. (cherry picked from commit 9907407fd1a5713f0366438394bd0e3776c2cf4e)
2019-11-27icera: setup as loadable 'shared' utilsAleksander Morgado3-8/+29
(cherry picked from commit a6d76cfcebab95c8e6338ab996df07b77f733e37)
2019-11-27plugin-manager: always make sure all needed symbols are availableAleksander Morgado1-2/+2
Never do lazy loading, we'll always make sure that a plugin will only be fully loaded if all the symbols it requires are already available. (cherry picked from commit 8fcc470a5cdea2987536df9436e99a19a58473eb)
2019-11-27plugin-manager: dynamically load 'shared' util librariesAleksander Morgado4-11/+124
(cherry picked from commit b1c3f1eb1c740975b3ea387ae5e08dc426643c8b)
2019-11-27ci: require autoconf-archiveAleksander Morgado1-1/+1
(cherry picked from commit 913f0d638d5380658c1ef008af67a69953323273)
2019-11-25bearer-qmi: plug memleaks during network disconnectionAleksander Morgado1-0/+2
(cherry picked from commit 260d34be76a94b2562b7cbfda2af43bc1ed57c70)
2019-11-19sierra: add port hints for EM7565 modemAmol Lad1-0/+8
(cherry picked from commit 8f4b5b52ee905b856cd1a73adadfb8dc70342d4a)
2019-11-15build,test: fix order of included librariesAleksander Morgado1-2/+2
Symbols are resolved forward, so if libhelpers depends on libmm-glib, it needs to be specified first. (cherry picked from commit 42dab8e827d84b86d0f7253ce68748758f29aef1)
2019-11-15cli,modem: avoid using deprecated mm_pco_list_free()Aleksander Morgado1-1/+1
(cherry picked from commit 16f40391595dfd880fc44260a4144d4b5952b429)
2019-11-13iface-modem-simple: don't assert ongoing connect cancellableAleksander Morgado1-1/+1
[11642]: <debug> [1573665255.321490] Couldn't reload current power state: QMI operation failed: Transaction timed out [11642]: <debug> [1573665255.321697] No need to change power state: already in 'on' power state [11642]: <debug> [1573665255.330864] Modem (Quectel) '/sys/devices/platform/ehci-platform/usb1/1-1' completely disposed ** ERROR:mm-iface-modem-simple.c:44:private_free: assertion failed: (!priv->ongoing_connect) If the modem goes away in the middle of a connection attempt, there's no explicit connection cancellation performed, we just cleanup the modem object. In this case, the ongoing attempt cancellable will still exist, so just clean it up as well. (cherry picked from commit 5e8c64d092e85f6d5479675499463464e1a42de6)