Re: Question about static analysis

2021-08-11 Thread Slava Monich
Hi everyone Can I inquire here? If it's a problem, I'll delete it. I have question about static analysis. below code, Why use after free? I can see modem.c and ussd.c, simfs.c let me know if you have any intentions. g_slist_remove() doesn't actually access the pointer. It doesn't even

Re: [PATCH] simfs: Fix reads beyond the first block

2021-07-30 Thread Slava Monich
On 30/07/2021 18.37, Denis Kenzior wrote: Hi Slava, On 7/30/21 7:07 AM, Slava Monich wrote: ---   src/simfs.c | 17 -   1 file changed, 8 insertions(+), 9 deletions(-) Funny how long this bug has been lurking around. Until we finally had a crash on reading an icon

[PATCH] simfs: Fix reads beyond the first block

2021-07-30 Thread Slava Monich
--- src/simfs.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/simfs.c b/src/simfs.c index 3d4f6283..cf770265 100644 --- a/src/simfs.c +++ b/src/simfs.c @@ -383,18 +383,18 @@ static void sim_fs_op_read_block_cb(const struct ofono_error *error, }

[PATCH] sim-auth: Parse auth response according to TS 31.102

2021-05-03 Thread Slava Monich
--- src/sim-auth.c | 34 ++- src/simutil.c | 146 +--- src/simutil.h | 13 ++-- unit/test-simutil.c | 125 - 4 files changed, 234 insertions(+), 84 deletions(-) diff --git a/src/sim-auth.c

Re: [PATCH] simutil: Fill unused part of AID with FFs

2021-05-01 Thread Slava Monich
On 30.4.2021 17.54, Denis Kenzior wrote: Hi Slava, On 4/29/21 11:09 AM, Slava Monich wrote: Correct handling of short AIDs will take more than that, but leaving part of the array uninitialized is wrong in any case. ---   src/simutil.c | 1 +   1 file changed, 1 insertion(+) diff --git a/src

[PATCH] simutil: Fill unused part of AID with FFs

2021-04-29 Thread Slava Monich
Correct handling of short AIDs will take more than that, but leaving part of the array uninitialized is wrong in any case. --- src/simutil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/simutil.c b/src/simutil.c index 5d2aa6a2..e648c918 100644 --- a/src/simutil.c +++ b/src/simutil.c @@

[PATCH 2/2] sim-auth: Only close open sessions

2021-04-26 Thread Slava Monich
Session has to be open in order to have a valid session_id --- src/sim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sim.c b/src/sim.c index 793ff64a..3319ecee 100644 --- a/src/sim.c +++ b/src/sim.c @@ -3805,7 +3805,8 @@ void __ofono_sim_remove_session_watch(struct

[PATCH 1/2] sim-auth: Remove watch if open_channel fails

2021-04-26 Thread Slava Monich
Otherwise open_channel won't be called again after a failure. --- src/sim-auth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sim-auth.c b/src/sim-auth.c index 0e13b533..3c3f35e7 100644 --- a/src/sim-auth.c +++ b/src/sim-auth.c @@ -367,6 +367,8 @@ static void

[PATCH] lte: Use the right D-Bus interface for property change signal

2020-06-16 Thread Slava Monich
--- src/lte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lte.c b/src/lte.c index fbe0116..951a06f 100644 --- a/src/lte.c +++ b/src/lte.c @@ -212,7 +212,7 @@ static void lte_set_default_attach_info_cb(const struct ofono_error *error, }

[PATCH] cbs: Allow the last CBS fragment to be truncated

2020-06-16 Thread Slava Monich
That does happen in real life. --- src/smsutil.c | 23 +++ src/smsutil.h | 1 + 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/smsutil.c b/src/smsutil.c index 8c084d4..450a1d3 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -1756,7 +1756,7 @@ gboolean

Re: [PATCH] src/modem: connection timeout to 60 seconds

2018-10-23 Thread Slava Monich
On 23/10/18 10:50, Giacinto Cifelli wrote: Changed the connection timeout to 60 seconds (from 20 seconds), to accomodate for chipset that take time to boot-up. Is it hard to make it configurable? Cheers, -Slava ___ ofono mailing list ofono@ofono.org

Re: [PATCH v7 6/7] gemalto/lte: Gemalto vendor lte atom

2018-10-18 Thread Slava Monich
On 18/10/18 22:32, Jonas Bonn wrote: ... +#include +#include + +#include "ofono.h" +#include "gemaltomodem.h" + +enum gemalto_auth_option { +    GEMALTO_AUTH_DEFAULTS    = 0x00, +    GEMALTO_AUTH_USE_SGAUTH    = 0x01, +    GEMALTO_AUTH_ORDER_PWD_USR    = 0x02, +   

Re: [PATCH 1/7] extended support for LTE and NR. Some minor fixes. part 1 of 7

2018-09-19 Thread Slava Monich
On 20/09/18 00:45, Denis Kenzior wrote: (ANY = PAP_CHAP, and don't ask me why we added new values to the beginning of the enum - it was before we started using binary plugins). I would be more than happy if upstream started to use the same enum! That assumes that we should support your

Re: [PATCH 1/7] extended support for LTE and NR. Some minor fixes. part 1 of 7

2018-09-19 Thread Slava Monich
On 19/09/18 19:32, Denis Kenzior wrote: Hi Slava, Anything in include is external API. We do maintain not just out-of-tree, but binary plugins. Backward (binary!) compatibility a must for us. Please do not break it. That is why we have 'OFONO_API_SUBJECT_TO_CHANGE' as a reminder. We mean

Re: [PATCH 1/7] extended support for LTE and NR. Some minor fixes. part 1 of 7

2018-09-19 Thread Slava Monich
On 19/09/18 18:21, Denis Kenzior wrote: Hi Giacinto, I would favour also renumbering with NONE on top, but I am not sure of the side effects everywhere, in case the values are used directly in commands. Actually there is no problem doing that.  The internal API is not stable.  Besides, it

Re: [PATCH 1/7] extended support for LTE and NR. Some minor fixes. part 1 of 7

2018-09-19 Thread Slava Monich
On 19/09/18 08:37, Giacinto Cifelli wrote: --- include/gprs-context.h | 1 + include/lte.h | 11 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/gprs-context.h b/include/gprs-context.h index 20ca9ef..8869c12 100644 --- a/include/gprs-context.h

Re: [PATCH] atmodem: add LTE state for AT+CREG

2018-09-10 Thread Slava Monich
Hi Denis, Hi Slava, On 09/10/2018 01:26 PM, Slava Monich wrote: Hi Anirudh, Denis at al. @@ -669,6 +669,10 @@ const char *registration_status_to_string(int status)   return "unknown";   case NETWORK_REGISTRATION_STATUS_ROAMING:   return "roam

Re: [PATCH] atmodem: add LTE state for AT+CREG

2018-09-10 Thread Slava Monich
Hi Anirudh, Denis at al. @@ -669,6 +669,10 @@ const char *registration_status_to_string(int status)   return "unknown";   case NETWORK_REGISTRATION_STATUS_ROAMING:   return "roaming"; +    case NETWORK_REGISTRATION_STATUS_REGISTERED_EUTRAN: +    return "registered lte";

Re: [PATCH 1/2] include: Add ofono_modem_get_voicecall

2018-07-02 Thread Slava Monich
On 02/07/18 18:34, Denis Kenzior wrote: Hi Slava, On 06/29/2018 08:57 AM, Slava Monich wrote: ---   include/modem.h | 2 ++   1 file changed, 2 insertions(+) diff --git a/include/modem.h b/include/modem.h index 005a42e..bed46c2 100644 --- a/include/modem.h +++ b/include/modem.h @@ -31,6 +31,7

[PATCH 2/2] modem: Implement ofono_modem_get_voicecall

2018-06-29 Thread Slava Monich
--- src/modem.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/modem.c b/src/modem.c index 9409347..9e25448 100644 --- a/src/modem.c +++ b/src/modem.c @@ -194,6 +194,11 @@ struct ofono_gprs *ofono_modem_get_gprs(struct ofono_modem *modem) return

[PATCH 1/2] include: Add ofono_modem_get_voicecall

2018-06-29 Thread Slava Monich
--- include/modem.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/modem.h b/include/modem.h index 005a42e..bed46c2 100644 --- a/include/modem.h +++ b/include/modem.h @@ -31,6 +31,7 @@ extern "C" { struct ofono_modem; struct ofono_gprs; struct ofono_sim; +struct ofono_voicecall;

[PATCH 3/3] dbus: Add D-Bus mapping for OFONO_ERROR_TYPE_ERRNO

2018-06-28 Thread Slava Monich
--- src/dbus.c | 38 +++--- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/dbus.c b/src/dbus.c index cadf5c6..a175178 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -24,6 +24,7 @@ #endif #include +#include #include #include "ofono.h" @@

[PATCH 2/3] emulator: Handle OFONO_ERROR_TYPE_ERRNO in switch

2018-06-28 Thread Slava Monich
--- src/emulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/emulator.c b/src/emulator.c index ccb26dc..b3afb3d 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -1347,6 +1347,7 @@ void ofono_emulator_send_final(struct ofono_emulator *em, case OFONO_ERROR_TYPE_CEER:

[PATCH 1/3] include: Add OFONO_ERROR_TYPE_ERRNO

2018-06-28 Thread Slava Monich
--- include/types.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/types.h b/include/types.h index 2c64b20..90d8c2c 100644 --- a/include/types.h +++ b/include/types.h @@ -56,6 +56,7 @@ enum ofono_error_type { OFONO_ERROR_TYPE_CEER, OFONO_ERROR_TYPE_SIM,

[PATCH] dbus: Make cme_errors_mapping static const

2018-06-28 Thread Slava Monich
--- src/dbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dbus.c b/src/dbus.c index 3e1e162..cadf5c6 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -37,7 +37,7 @@ struct error_mapping_entry { DBusMessage *(*ofono_error_func)(DBusMessage *); }; -struct

[PATCH] dbus: Add D-Bus mapping for generic errors

2018-06-28 Thread Slava Monich
This allows plugins/drivers to be a bit more specific about what went wrong. --- src/dbus.c | 28 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/dbus.c b/src/dbus.c index 3e1e162..7ea86ed 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -24,6 +24,7 @@

Re: [PATCH 01/12] include: Expose voicecall related enums to plugins

2018-06-25 Thread Slava Monich
On 25/06/18 18:40, Denis Kenzior wrote: Hi Slava, On 06/21/2018 12:20 PM, Slava Monich wrote: ---   include/types.h | 31 +++   1 file changed, 31 insertions(+) Can you help me understand what is the motivation behind this?  In the past we opted not to expose

[PATCH] voicecall: Handle voicecall_dbus_register() return value

2018-06-23 Thread Slava Monich
FALSE means that struct voicecall passed in as a parameter has been deallocated. --- src/voicecall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/voicecall.c b/src/voicecall.c index e4f6a4c..194b75f 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -1391,7

[PATCH 11/12] voicecall: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- src/voicecall.c | 144 1 file changed, 73 insertions(+), 71 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index e4f6a4c..a5de038 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -177,10 +177,10 @@ static const char

[PATCH 12/12] common: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- src/common.c | 20 ++-- src/common.h | 33 + 2 files changed, 11 insertions(+), 42 deletions(-) diff --git a/src/common.c b/src/common.c index 3ccaf7c..06b3521 100644 --- a/src/common.c +++ b/src/common.c @@ -740,26 +740,26 @@ const char

[PATCH 08/12] cdma-voicecall: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- src/cdma-voicecall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cdma-voicecall.c b/src/cdma-voicecall.c index fd38dd8..90cad10 100644 --- a/src/cdma-voicecall.c +++ b/src/cdma-voicecall.c @@ -251,7 +251,7 @@ static void manager_dial_callback(const struct

[PATCH 09/12] emulator: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- src/emulator.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index ccb26dc..bda8f35 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -404,9 +404,9 @@ static gboolean notify_ccwa(void *user_data)

[PATCH 10/12] stk: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- src/stk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stk.c b/src/stk.c index 9cdf2b1..eb27555 100644 --- a/src/stk.c +++ b/src/stk.c @@ -1732,7 +1732,7 @@ static void call_setup_connected(struct ofono_call *call, void *data) static struct ofono_error

[PATCH 06/12] rilmodem: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- drivers/rilmodem/voicecall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/rilmodem/voicecall.c b/drivers/rilmodem/voicecall.c index b7180b9..585f216 100644 --- a/drivers/rilmodem/voicecall.c +++ b/drivers/rilmodem/voicecall.c @@ -288,7 +288,7 @@ no_calls:

[PATCH 03/12] hfpmodem: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- drivers/hfpmodem/voicecall.c | 92 +++- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c index 6ffe9d5..1ab2aa2 100644 --- a/drivers/hfpmodem/voicecall.c +++

[PATCH 01/12] include: Expose voicecall related enums to plugins

2018-06-21 Thread Slava Monich
--- include/types.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/include/types.h b/include/types.h index 2c64b20..a562bfe 100644 --- a/include/types.h +++ b/include/types.h @@ -49,6 +49,37 @@ enum ofono_clir_option { OFONO_CLIR_OPTION_SUPPRESSION,

[PATCH 04/12] huaweimodem: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- drivers/huaweimodem/voicecall.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/huaweimodem/voicecall.c b/drivers/huaweimodem/voicecall.c index f55568d..36a16a1 100644 --- a/drivers/huaweimodem/voicecall.c +++ b/drivers/huaweimodem/voicecall.c

[PATCH 07/12] stemodem: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- drivers/stemodem/voicecall.c | 77 +++- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c index 356ab7c..eb4431c 100644 --- a/drivers/stemodem/voicecall.c +++

[PATCH 05/12] ifxmodem: Use new voicecall enums

2018-06-21 Thread Slava Monich
--- drivers/ifxmodem/voicecall.c | 59 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c index 45b5ca4..9055b2d 100644 --- a/drivers/ifxmodem/voicecall.c +++

[PATCH 1/2] include: Add ofono_voicecall_get_modem

2018-06-20 Thread Slava Monich
--- include/voicecall.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/voicecall.h b/include/voicecall.h index 5b3da6a..a704b65 100644 --- a/include/voicecall.h +++ b/include/voicecall.h @@ -160,6 +160,8 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id, */

[PATCH 2/2] voicecall: Implement ofono_voicecall_get_modem

2018-06-20 Thread Slava Monich
--- src/voicecall.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/voicecall.c b/src/voicecall.c index e4f6a4c..7d4f6a1 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -3734,6 +3734,11 @@ void *ofono_voicecall_get_data(struct ofono_voicecall *vc) return

[PATCH] ussd: Cancel pending requests when unregistering

2018-05-23 Thread Slava Monich
And reset state to idle before unregistering the D-Bus interface. This may occur e.g. when we receive REFRESH from STK. --- src/ussd.c | 16 1 file changed, 16 insertions(+) diff --git a/src/ussd.c b/src/ussd.c index f5dd9d9..23b3323 100644 --- a/src/ussd.c +++ b/src/ussd.c @@

[PATCH 2/2] modem: Implement ofono_modem_get_gprs

2018-04-26 Thread Slava Monich
--- src/modem.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/modem.c b/src/modem.c index 0cee861..9409347 100644 --- a/src/modem.c +++ b/src/modem.c @@ -189,6 +189,11 @@ struct ofono_sim *ofono_modem_get_sim(struct ofono_modem *modem) return

[PATCH 1/2] include: Add ofono_modem_get_gprs

2018-04-26 Thread Slava Monich
--- include/modem.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/modem.h b/include/modem.h index c93b3d2..005a42e 100644 --- a/include/modem.h +++ b/include/modem.h @@ -29,6 +29,7 @@ extern "C" { #include struct ofono_modem; +struct ofono_gprs; struct ofono_sim; enum

[PATCH] ussd: Don't ignore data from TERMINATED response

2018-04-23 Thread Slava Monich
Typically responses to USSD requests are coming with status zero (NOTIFY) but some are coming with status 2 (TERMINATED). If those contain data, the data should be presented to the user. --- src/ussd.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ussd.c

[PATCH] phonebook: Fixed double deletion of merge_list

2018-02-22 Thread Slava Monich
--- src/phonebook.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/phonebook.c b/src/phonebook.c index 1e4efa2..f8936c5 100644 --- a/src/phonebook.c +++ b/src/phonebook.c @@ -428,7 +428,6 @@ static void export_phonebook_cb(const struct ofono_error *error, void *data)

Re: Plugin infrastructure

2018-02-05 Thread Slava Monich
On 05/02/18 20:55, Jonas Bonn wrote: On 02/05/2018 05:25 PM, Slava Monich wrote: Hi Jonas, On 02/04/2018 11:19 AM, Jonas Bonn wrote: Hi, I was reading through the ofono code and I see that there's a lot of code in place to support external plugins.  As things currently stand, however

Re: Plugin infrastructure

2018-02-05 Thread Slava Monich
Hi Jonas, On 02/04/2018 11:19 AM, Jonas Bonn wrote: Hi, I was reading through the ofono code and I see that there's a lot of code in place to support external plugins.  As things currently stand, however, ofono can only be built with _builtin_ modules, so all this plugin infrastructure is

[PATCH] unit: Improve idmap.c unit test coverage

2018-01-18 Thread Slava Monich
This brings function, line and branch coverage for idmap.c to 100% --- unit/test-idmap.c | 24 1 file changed, 24 insertions(+) diff --git a/unit/test-idmap.c b/unit/test-idmap.c index b072933..2d2e226 100644 --- a/unit/test-idmap.c +++ b/unit/test-idmap.c @@ -35,9

[PATCH] dbus: Use dbus_validate_path

2018-01-18 Thread Slava Monich
Instead of __ofono_dbus_valid_object_path --- plugins/push-notification.c | 2 +- plugins/smart-messaging.c | 2 +- src/dbus.c | 44 src/gnss.c | 2 +- src/modem.c | 2 +- src/netmon.c

Re: Problem with dialstring ##21#

2018-01-16 Thread Slava Monich
On 16/01/18 14:50, Engelbert Torremans wrote: All, I am looking for some help in trying to fix this problem I am experiencing when using Ofono on a RaspberryPi in "carkit/HFP mode". Currently I can make calls (originate and terminate) and audio is fine in combination with Bluez5 etc. also.

[PATCH] sim: Don't submit parallel EFpl reads

2017-12-08 Thread Slava Monich
In addition to not doing unnecessary SIM I/O, this fixes memory leaks like this one: ==10096== 74 (56 direct, 18 indirect) bytes in 2 blocks are definitely lost in loss record 1,252 of 1,342 ==10096==at 0x4841BF0: calloc (vg_replace_malloc.c) ==10096==by 0x4B03117: g_malloc0 (gmem.c)

Re: [PATCH] sim: Handle multiple EFpl read completions

2017-12-08 Thread Slava Monich
On 08/12/17 17:14, Denis Kenzior wrote: ... Can we do something like if (sim->language_prefs_update) return; ? Yes, of course! Forget this patch then, I'll send a new one. Cheers, -Slava ___ ofono mailing list ofono@ofono.org

Re: [PATCH] sim: Handle multiple EFpl read completions

2017-12-08 Thread Slava Monich
Since sim_efli_efpl_changed() can be invoked several times before completion of SIM reads (which are not cancellable), followed by multiple completions, it's not enough to free old sim->language_prefs in sim_efli_efpl_changed(). The same thing has to be done by sim_efpl_read_cb() to avoid leaking

[PATCH] sim: Handle multiple EFpl read completions

2017-12-07 Thread Slava Monich
Since sim_efli_efpl_changed() can be invoked several times before completion of SIM reads (which are not cancellable), followed by multiple completions, it's not enough to free old sim->language_prefs in sim_efli_efpl_changed(). The same thing has to be done by sim_efpl_read_cb() to avoid leaking

[PATCH] sim-auth: Avoid using dbus_message_iter_get_element_count

2017-11-27 Thread Slava Monich
It's the only thing in ofono that requires dbus 1.9.16 or later and it's not worth it. And don't leak DBusMessage on format error. --- src/sim-auth.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/sim-auth.c b/src/sim-auth.c index f9f74d4..7b65738

[PATCH 2/2] storage: Implement ofono_config_dir and ofono_storage_dir

2017-11-27 Thread Slava Monich
--- src/storage.c | 12 1 file changed, 12 insertions(+) diff --git a/src/storage.c b/src/storage.c index bde0bea..9b7bfbc 100644 --- a/src/storage.c +++ b/src/storage.c @@ -23,6 +23,8 @@ #include #endif +#include + #define _GNU_SOURCE #include #include @@ -35,6 +37,16 @@

[PATCH 1/2] include: Add storage.h

2017-11-27 Thread Slava Monich
To expose ofono directories to dynamically loadable plugins. --- Makefile.am | 3 ++- include/storage.h | 32 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 include/storage.h diff --git a/Makefile.am b/Makefile.am index

Re: [PATCH] sim: Move atom registration to the end of ofono_sim_register

2017-10-27 Thread Slava Monich
Hi Denis, On 27/10/17 16:56, Denis Kenzior wrote: Hi Slava, On 10/27/2017 08:15 AM, Slava Monich wrote: The state needs to be checked prior to calling __ofono_atom_register because atom registration calls OFONO_ATOM_WATCH_CONDITION_REGISTERED callbacks each of which may call

[PATCH] sim: Move atom registration to the end of ofono_sim_register

2017-10-27 Thread Slava Monich
The state needs to be checked prior to calling __ofono_atom_register because atom registration calls OFONO_ATOM_WATCH_CONDITION_REGISTERED callbacks each of which may call ofono_sim_inserted_notify. Should that happen, by the time __ofono_atom_register returns, ofono_sim will be in

[PATCH] gatchat: Removed unused GAtPPP field

2017-10-26 Thread Slava Monich
--- gatchat/gatppp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c index 5144084..4a80b4b 100644 --- a/gatchat/gatppp.c +++ b/gatchat/gatppp.c @@ -40,7 +40,6 @@ #include "crc-ccitt.h" #include "ppp.h" -#define DEFAULT_MRU1500 #define

[PATCH] gatmux: Remove write watch source at shutdown

2017-10-23 Thread Slava Monich
Otherwise write_watcher_destroy_notify can be invoked after GAtMux has been deallocated which results in write after free: ==3952== Invalid write of size 4 ==3952==at 0xABF54: write_watcher_destroy_notify (gatmux.c:285) ==3952==by 0x4AF21E7: g_source_callback_unref (gmain.c:1561) ==3952==

[PATCH v3] atmodem: Query the list of supported s from the modem

2017-10-23 Thread Slava Monich
Not all modems support all s (particularly, "PS"), let's be polite and not ask them for the ones they don't support. --- drivers/atmodem/sim.c | 57 --- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/drivers/atmodem/sim.c

Re: [PATCH v2] atmodem: Query the list of supported s from the modem

2017-10-23 Thread Slava Monich
On 23/10/17 23:33, Denis Kenzior wrote: Hi Slava, On 10/23/2017 03:21 PM, Slava Monich wrote: Not all modems support all s (particularly, "PS"), let's be polite and not ask them for the ones they don't support. ---   drivers/atmodem/

[PATCH v2] atmodem: Query the list of supported s from the modem

2017-10-23 Thread Slava Monich
Not all modems support all s (particularly, "PS"), let's be polite and not ask them for the ones they don't support. --- drivers/atmodem/sim.c | 57 --- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/drivers/atmodem/sim.c

[PATCH] atmodem: Query the list of supported s from the modem

2017-10-23 Thread Slava Monich
Not all modems support all s (particularly, "PS"), let's be polite and not ask them for the ones they don't support. --- drivers/atmodem/sim.c | 69 ++- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/drivers/atmodem/sim.c

Re: [PATCHv2] simauth: fixup adding more dbus return checks

2017-10-23 Thread Slava Monich
Hi James, On 16/10/17 19:06, James Prestwood wrote: --- src/sim-auth.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/sim-auth.c b/src/sim-auth.c index b9552b5..9ae5574 100644 --- a/src/sim-auth.c +++ b/src/sim-auth.c @@ -427,6 +427,7 @@

[PATCH] gatmux: Remove finalized watches from the list

2017-10-23 Thread Slava Monich
Leaving them there may result in invalid reads like this: ==2312== Invalid read of size 4 ==2312==at 0xAB8C0: dispatch_sources (gatmux.c:134) ==2312==by 0xAC5D3: channel_close (gatmux.c:479) ==2312==by 0x4AE8885: g_io_channel_shutdown (giochannel.c:523) ==2312==by 0x4AE8A1D:

[PATCH] atmodem: Fix use after free in sim_state_cb

2017-10-05 Thread Slava Monich
==2941== Invalid read of size 4 ==2941==at 0x69338: sim_state_cb (sim.c:1301) ==2941==by 0x71DCB: cpin_check_cb (atutil.c:567) ==2941==by 0xA602B: at_chat_finish_command (gatchat.c:459) ==2941==by 0xA6277: at_chat_handle_command_response (gatchat.c:521) ==2941==by 0xA6587:

[PATCH 2/2] modem: Implement ofono_modem_get_sim

2017-09-29 Thread Slava Monich
--- src/modem.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/modem.c b/src/modem.c index ac361be..4af0551 100644 --- a/src/modem.c +++ b/src/modem.c @@ -184,6 +184,11 @@ const char *ofono_modem_get_path(struct ofono_modem *modem) return NULL; } +struct ofono_sim

[PATCH 1/2] include: Add ofono_modem_get_sim

2017-09-29 Thread Slava Monich
--- include/modem.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/modem.h b/include/modem.h index e40b23e..c93b3d2 100644 --- a/include/modem.h +++ b/include/modem.h @@ -29,6 +29,7 @@ extern "C" { #include struct ofono_modem; +struct ofono_sim; enum ofono_modem_type {

Re: [PATCH 1/7] netmon: modified api.txt for network monitor agent

2017-09-09 Thread Slava Monich
Hi Denis, Hi Slava, In the Sailfish OS case, one is the positioning helper, and there's the factory test app. That makes it at least two. The factory test app often plays the role of the second client since it's touching pretty much all the important interfaces in the system. And there are

Re: [PATCH 1/7] netmon: modified api.txt for network monitor agent

2017-09-07 Thread Slava Monich
On 07/09/17 19:05, Denis Kenzior wrote: Hi Slava, On 09/07/2017 08:06 AM, Slava Monich wrote: On 07/09/17 12:47, Jonas Bonn wrote: On 09/07/2017 06:23 AM, Nishanth V wrote: added new DBUS methods RegisterAgent and UnregisterAgent to Networkmonitor interface so that any client of ofono can

Re: [PATCH 1/7] netmon: modified api.txt for network monitor agent

2017-09-07 Thread Slava Monich
On 07/09/17 12:47, Jonas Bonn wrote: On 09/07/2017 06:23 AM, Nishanth V wrote: added new DBUS methods RegisterAgent and UnregisterAgent to Networkmonitor interface so that any client of ofono can register for serving cell updates. Added new agent interface NetworkMonitorAgent with two methods,

[PATCH] unit: Avoid use of uninitialised data in test-simutil

2017-08-24 Thread Slava Monich
GTest: run: /testsimutil/ber tlv encode EFpnn ==16777== Conditional jump or move depends on uninitialised value(s) ==16777==at 0x4068CB: ber_tlv_iter_next (simutil.c:369) ==16777==by 0x406C39: ber_tlv_find_by_tag (simutil.c:483) ==16777==by 0x407E1D: sim_eons_add_pnn_record

[PATCH] sms: Pass const pointer to dispatch_app_datagram

2017-08-19 Thread Slava Monich
--- src/sms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sms.c b/src/sms.c index 17c5a9c..b86158e 100644 --- a/src/sms.c +++ b/src/sms.c @@ -1171,7 +1171,8 @@ static gboolean compute_incoming_msgid(GSList *sms_list, static void dispatch_app_datagram(struct

[PATCH] ussd: Switch the state from USER_ACTION to IDLE

2017-06-21 Thread Slava Monich
... when a USSD notification is received. Some networks send 0 (no further user action required) after the response timeout expires. That should result in the user input form getting removed from the ME screen. --- src/ussd.c | 14 ++ 1 file changed, 14 insertions(+) diff --git

[PATCH] radio-settings: Fix memory leaks in radio_load_settings

2017-06-02 Thread Slava Monich
Errors returned by g_key_file_get_integer have to be deallocated by the caller to avoid leaks like these: ==13330== 104 (24 direct, 80 indirect) bytes in 2 blocks are definitely lost ==13330==at 0x483F3EC: malloc (vg_replace_malloc.c) ==13330==by 0x4B020DF: g_malloc (gmem.c) ==13330==

[PATCH] simfs: Prevent a crash in sim_fs_notify_file_watches

2017-05-12 Thread Slava Monich
If no file watchers have ever been added, context->file_watches is NULL and sim_fs_notify_file_watches() should take that into account. --- src/simfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/simfs.c b/src/simfs.c index 595dbad..37a232a 100644 --- a/src/simfs.c +++

[PATCH] test-sms: Fixed memory leaks in the unit test

2017-01-02 Thread Slava Monich
--- unit/test-sms.c | 5 + 1 file changed, 5 insertions(+) diff --git a/unit/test-sms.c b/unit/test-sms.c index 3d0f016..618d139 100644 --- a/unit/test-sms.c +++ b/unit/test-sms.c @@ -1145,6 +1145,8 @@ static void test_assembly(void) reencoded = sms_decode_text(l); +

[PATCH] smsutil: Prevent out of bounds reads in cbs_decode_text

2017-01-01 Thread Slava Monich
Valgrind was complaining about it like this: ==18099== Conditional jump or move depends on uninitialised value(s) ==18099==at 0x4C32281: strspn ==18099==by 0x41286B: cbs_decode_text (smsutil.c:4140) ==18099==by 0x40675C: test_cbs_encode_decode (test-sms.c:1417) --- src/smsutil.c | 9

[PATCH] smsutil: Fix receiving UTF-16 encoded messages with split 4-byte char

2016-11-18 Thread Slava Monich
The spec supports UCS2, but in reality UTF-16 is used, which supports 4-byte characters, which could be split into different message fragments. Accumulate the entire UTF-16 message before converting to UTF8. Author: Martin Jones --- src/smsutil.c | 30

[PATCH] gprs: Check GPRS_FLAG_ATTACHED_UPDATE in pri_deactivate_callback

2016-11-03 Thread Slava Monich
This prevents attached state from getting stuck at 0 like this: 1. Context deactivation is initiated over D-Bus, ctx->pending is set 2. Attached becomes FALSE, context is still marked as active 3. Attached becomes TRUE, gprs_attached_update sets GPRS_FLAG_ATTACHED_UPDATE 4. Deactivation

[PATCH] gprs: Check GPRS_FLAG_ATTACHED_UPDATE in pri_deactivate_callback

2016-11-01 Thread Slava Monich
This prevents attached state from getting stuck at 0 like this: 1. Context deactivation is initiated over D-Bus, ctx->pending is set 2. Attached becomes FALSE, context is still marked as active 3. Attached becomes TRUE, gprs_attached_update sets GPRS_FLAG_ATTACHED_UPDATE 4. Deactivation

[PATCH] netmon: Make sure we don't pass NULL message to g_dbus_send_message

2016-10-14 Thread Slava Monich
Also that we don't lose the reply message. --- src/netmon.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/netmon.c b/src/netmon.c index 9d6de07..eb18b9c 100644 --- a/src/netmon.c +++ b/src/netmon.c @@ -199,9 +199,24 @@ static void

[PATCH] gprs-context: Remove unused field from struct ofono_gprs_primary_context

2016-10-10 Thread Slava Monich
--- include/gprs-context.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/gprs-context.h b/include/gprs-context.h index c4910f2..ab67326 100644 --- a/include/gprs-context.h +++ b/include/gprs-context.h @@ -55,7 +55,6 @@ enum ofono_gprs_auth_method { struct

[PATCH] main: Make -d option repeatable

2016-10-04 Thread Slava Monich
Concatenating the patterns makes more sense than using the last supplied value and leaking the previous allocated patterns. --- src/main.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 46bb90b..b43bb4e 100644 --- a/src/main.c

[PATCH] call-forwarding: allow multiple pending GetProperties

2016-07-18 Thread Slava Monich
The very first call that that every org.ofono.CallForwarding client makes is GetProperties. With multiple clients, only the first one was waiting for the completion of the initial query, all other calls were rejected with org.ofono.Error.InProgress. In theory, the clients could retry the call

[PATCH] sim: Query the status of SC facility lock

2016-07-06 Thread Slava Monich
Resending after adjusting code style. --- src/sim.c | 72 +++ 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/src/sim.c b/src/sim.c index aedc617..e2da78d 100644 --- a/src/sim.c +++ b/src/sim.c @@ -2449,58 +2449,50 @@

[PATCH] sim: Query the status of SC facility lock

2016-07-06 Thread Slava Monich
Otherwise "pin" entry in LockedPins may be lost after ofono is restarted. --- src/sim.c | 80 +-- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/src/sim.c b/src/sim.c index aedc617..634acfc 100644 --- a/src/sim.c +++

Re: [PATCH] gprs: Setup route for mmsc if there's no mms proxy

2015-01-22 Thread Slava Monich
And don't setup mms route at all if mmsc/proxy host name is not in dotted IPv4 format. --- src/gprs.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) Sorry, somehow I missed the reply to this patch and just accidentally found it (the reply) at

[PATCH] gprs: Setup route for mmsc if there's no mms proxy

2015-01-06 Thread Slava Monich
And don't setup mms route at all if mmsc/proxy host name is not in dotted IPv4 format. --- src/gprs.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 05ab499..9c643b9 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -585,13

[PATCH] network: Add NetworkRegistration.OperatorsChanged signal

2014-12-31 Thread Slava Monich
This signal gets emitted when operator list has changed. It contains the current list of operators. --- doc/network-api.txt | 5 + src/network.c | 44 +++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/doc/network-api.txt

[PATCH] sim: Handle multiple invocations of sim_imsi_obtained

2014-05-06 Thread Slava Monich
To avoid leaking memory and issuing unnecessary D-Bus signals --- src/sim.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sim.c b/src/sim.c index edae5eb..1b0cb80 100644 --- a/src/sim.c +++ b/src/sim.c @@ -1425,11 +1425,18 @@ static void sim_set_ready(struct

Re: [PATCH] sim: Handle multiple invocations of sim_imsi_obtained

2014-05-06 Thread Slava Monich
Hi Denis, To avoid leaking memory and issuing unnecessary D-Bus signals --- src/sim.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sim.c b/src/sim.c index edae5eb..1b0cb80 100644 --- a/src/sim.c +++ b/src/sim.c @@ -1425,11 +1425,18 @@ static void

Re: [PATCH] mbpi: Parse gsm provider name

2014-04-18 Thread Slava Monich
Hi Denis, Hi Slava, Operators share mcc/mnc meaning that automatically finding the best AP (the one most likely to work) from the database may involve some sort of fuzzy logic (partial or case-insensitive name comparison or something like this) implemented in a product-specific provisioning

[PATCH] mbpi: Return provider name to the provisioning plugin

2014-04-18 Thread Slava Monich
Second try, this time not touching core interfaces. --- plugins/mbpi.c | 59 - plugins/mbpi.h | 14 - plugins/provision.c | 15 +++--- tools/lookup-apn.c | 5 +++-- 4 files changed, 77 insertions(+), 16

Re: [PATCH] mbpi: Parse gsm provider name

2014-04-17 Thread Slava Monich
Hi Denis, It's for custom provisioning plugins. Service provider name is passed to the provisioning plugin but not used there at all. This patch makes it possible to utilize it for AP matching. Regards, -Slava On 17/04/14 07:07, Denis Kenzior wrote: Hi Slava, On 04/16/2014 09:00 AM, Slava

Re: [PATCH] mbpi: Parse gsm provider name

2014-04-17 Thread Slava Monich
Hi Denis, Hi Slava, Please do not top-post on this mailing list. ah, sorry. On 04/17/2014 03:24 AM, Slava Monich wrote: Hi Denis, It's for custom provisioning plugins. Service provider name is passed to the provisioning plugin but not used there at all. This patch makes it possible

Re: [PATCH] mbpi: Parse gsm provider name

2014-04-17 Thread Slava Monich
Hi Denis, If instead I changed the interface between mbpi and provisioning plugin and kept the interface with the core intact, would that look acceptable to you? Perhaps, but I'm still failing to see why the service provider name as entered in MBPI is useful to anyone. Operators share mcc/mnc

  1   2   >