Convert all usages of this function in favor of using a static VERBOSE
variable. We almost never use verbose output except while debugging.
Additionally this allows us to more easily convert all unit tests to the
ell unit test framework
inet_ntoa was called twice in a row and as a result both primay and
secondary DNS were pointing to same static buffer containing last
value (secondary DNS).
As a result, ofono always advertised the secondary DNS twice through
DBus ConnectionContext.GetProperties 'DomainNameServers'.
Related: https://osmocom.org/issues/3031
CC drivers/mbimmodem/mbim.o
drivers/mbimmodem/mbim.c: In function ‘command_write_handler’:
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
l_info("n_iov: %lu, %lu", n_iov + 1, (size_t) written);
^
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat=]
drivers/mbimmodem/mbim.c: In function ‘command_read_handler’:
drivers/mbimmodem/mbim.c:649:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
l_info("header_offset: %lu", device->header_offset);
^
drivers/mbimmodem/mbim.c:650:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
l_info("segment_bytes_remaining: %lu", device->segment_bytes_remaining);
^
The ofono phone number max length is 80 so a buffer size of 64 is
obviously insufficient. Expanding the buffer to 128 prevents a
potential failure and suppresses the folowing compiler warning:
../drivers/atmodem/sms.c: In function ‘at_csca_set’:
../drivers/atmodem/sms.c:108:40: warning: ‘%s’ directive output may be truncated writing up to 80 bytes into a region of size 55 [-Wformat-truncation=]
snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
^~
../drivers/atmodem/sms.c:108:2: note: ‘snprintf’ output between 13 and 103 bytes into a destination of size 64
snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ofono_lte_default_attach_info now handles also the protocol and the
authentication method, username and password.
Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>