Skip to content

Conversation

@jarvte
Copy link
Contributor

@jarvte jarvte commented Aug 14, 2019

Description

Binary compiled with IAR crashes when trying to print null string. Fixed to print 'null' when the dns test is trying to print an empty ip address.
Fixed also that there should not be an empty ip address after connect. After fix, still some modems don't give an ip address even they have it. This can't be fixed but network communication works properly.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@kivaisan @kimlep01

Test case printed IP address. If ip address is null, IAR compiled binary fails.
Added check for printing null. If IP address is null, then it prints string 'null'.
@jarvte jarvte force-pushed the fix_cellular_dns_test branch from 84bb815 to 2ebc648 Compare August 14, 2019 07:37
@ciarmcom ciarmcom requested review from a team, kimlep01 and kivaisan August 14, 2019 09:00
@ciarmcom
Copy link
Member

@jarvte, thank you for your changes.
@kimlep01 @kivaisan @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-test @ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

// no IPV4 address, return
return NULL;
}
len = _at.read_string(_ip, NSAPI_IPv4_SIZE);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PDP_IPV6_SIZE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, fixed

if (_stack_type != IPV4_STACK) {
if (len != -1 && _stack_type != IPV4_STACK) {
// in case stack type is not IPV4 only, try to look also for IPV6 address
(void)_at.read_string(_ip, PDP_IPV6_SIZE);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, can't do that as this is an optional value

CellularContext now tries to get an IP address after connect and before
sending NSAPI_STATUS_GLOBAL_UP. Even if we don't the IP address from
the modem we will send NSAPI_STATUS_GLOBAL_UP and return success.
Modem has an ip address but for some reason some modems don't
give it to us.
@jarvte jarvte force-pushed the fix_cellular_dns_test branch from 2ebc648 to 6a17d74 Compare August 14, 2019 09:54
if (_stack_type != IPV4_STACK) {
if (len != -1 && _stack_type != IPV4_STACK) {
// in case stack type is not IPV4 only, try to look also for IPV6 address
(void)_at.read_string(_ip, PDP_IPV6_SIZE);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, can't do that as this is an optional value

Test case printed IP address. If ip address is null, IAR compiled binary fails.
Added check for printing null. If IP address is null, then it prints string 'null'.
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 21, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-test

@adbridge
Copy link
Contributor

restarted

@mbed-ci
Copy link

mbed-ci commented Aug 21, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit 5c09ff1 into ARMmbed:master Aug 22, 2019
@adbridge
Copy link
Contributor

Sitting on top of 5.14 changes so targeting for 5.14 now instead

@jarvte jarvte deleted the fix_cellular_dns_test branch January 17, 2020 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants