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

feat(console): Added command getaddrinfo, set/get dnsserver to console_cmd_ping #584

Conversation

espressif-abhikroy
Copy link
Collaborator

Added command getaddrinfo, setdnsserver, getdnsserver to console_cmd_ping component.
Removed WHOLE_ARCHIVE from CMakelist, and allows users to disable auto-registration of console_cmd_ping component.

*
* @return esp_err_t Returns ESP_OK on success, or an error code on failure.
*/
static esp_err_t set_dns_server(uint32_t addr, esp_netif_dns_type_t type)
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we support only IPv4 addresses?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The initial implementation was only for ipv4. Updated to use ipv6 also.
Now this is supported
setdnsserver 8.8.8.8 fe80::b0be:83ff:fe77:dd64 www.xyz.com

Copy link
Collaborator

@david-cermak david-cermak left a comment

Choose a reason for hiding this comment

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

LGTM, just left few nitpicks

while ((esp_netif = esp_netif_next(esp_netif)) != NULL) {
#endif
struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)res_tmp->ai_addr;
memcpy(dns.ip.u_addr.ip6.addr, &ipv6->sin6_addr, sizeof(dns.ip.u_addr.ip6.addr));

Check warning

Code scanning / clang-tidy

Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning

Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
1.1.0
Features
- Added command getaddrinfo, set/get dnsserver to console_cmd_ping (b80c19d)
@espressif-abhikroy espressif-abhikroy merged commit f198967 into espressif:master Aug 15, 2024
47 checks passed
@espressif-abhikroy espressif-abhikroy deleted the component/console_cmd_ping branch August 15, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants