Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature-wisun] Enable Nanostack DNS cache usage #13507

Merged
merged 6 commits into from
Sep 3, 2020

Conversation

artokin
Copy link
Contributor

@artokin artokin commented Aug 28, 2020

Summary of changes

Enable usage of Nanostack DNS cache. The cache may contain DNS server address and DNS query results.

Inherit methods gethostbyname, gethostbyname_async and get_dns_server to Nanostack class.
Methods will try to find DNS server address or DNS query results from Nanostack DNS cache.

Impact of changes

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


return -1;
}

interface_id = atoi(&interface_name[3]);
Copy link

Choose a reason for hiding this comment

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

Do all interfaces have exactly 4 leters ? Mesh ETH? TUN? is there possibility to search first number and then atoi it instead of assuming

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, this is problematic. Interface name is created https://github.com/ARMmbed/mbed-os/blob/feature-wisun/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp#L132 and but it can also be given from application.

Choose a reason for hiding this comment

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

Application returns interface name that the nanostack interfaces have returned, so nanostack is in full control of those. Nanostack interface naming pattern is to have always 3 letters and a number.

if (nanostack_dns_query_result_check(name, address, interface_name) == 0) {
return 0;
}

Choose a reason for hiding this comment

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

Should have the "if (version == NSAPI_UNSPEC) { " and in that case set version ipv6. Resolving ipv4 addresses with nanostack is bit weird since stack does not have ipv4, but I guess no reason to force reject for those either.


// try nanostack DNS cache, if not found then fallback to dns query
if (nanostack_dns_query_result_check(name, address, interface_name) == 0) {
return 0;

Choose a reason for hiding this comment

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

return NSAPI_ERROR_OK

callback(NSAPI_ERROR_OK, &address);
return NSAPI_ERROR_OK;
}

Choose a reason for hiding this comment

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

also check for unspecified version

@artokin
Copy link
Contributor Author

artokin commented Aug 31, 2020

@amarjeet-arm would you please check. This PR contains API that can be used to set DNS query results to Nanostack cache.

0xc0170
0xc0170 previously approved these changes Aug 31, 2020
@mbed-ci
Copy link

mbed-ci commented Aug 31, 2020

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM-lts

@artokin
Copy link
Contributor Author

artokin commented Aug 31, 2020

One API is missing from the WisunBorderRouter class, will add it shortly!

mikter
mikter previously approved these changes Aug 31, 2020
@mergify mergify bot dismissed stale reviews from 0xc0170 and mikter August 31, 2020 13:37

Pull request has been modified.

@0xc0170 0xc0170 self-requested a review September 1, 2020 09:26
@mergify
Copy link

mergify bot commented Sep 2, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@mergify mergify bot removed the needs: review label Sep 2, 2020
Arto Kinnunen added 5 commits September 2, 2020 12:41
Inherit methods gethostbyname, gethostbyname_async and get_dns_server
to Nanostack class. Methods will try to find DNS server address
or DNS query results from Nanostack DNS cache.
-Check address version NSAPI_UNSPEC
-Disable traces
-More specific interface ID parsing
-Harmonize return values
Add set_dns_query_result to WisunBorderRouter.
@artokin
Copy link
Contributor Author

artokin commented Sep 2, 2020

Rebased on top of the latest feature-wisun, please re-review.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 2, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Sep 2, 2020

Test run: FAILED

Summary: 1 of 3 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM-lts

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 2, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Sep 2, 2020

Test run: SUCCESS

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

@artokin artokin merged commit e46dd97 into ARMmbed:feature-wisun Sep 3, 2020
@artokin artokin deleted the enable_nanostack_dns_cache branch September 3, 2020 08:46
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.

5 participants