You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "zhhyu7 (via GitHub)" <gi...@apache.org> on 2026/04/22 09:04:20 UTC

[PR] netlib: support checkipconnectivity when use reslov.conf [nuttx-apps]

zhhyu7 opened a new pull request, #3460:
URL: https://github.com/apache/nuttx-apps/pull/3460

   ## Summary
   Improve netlib_check_ipconnectivity() to support DNS nameservers from resolv.conf via dns_foreach_nameserver(), instead of relying on the compile-time CONFIG_NETDB_DNSSERVER_IPv4ADDR macro.
   
   ## Impact
   - Add dns_ping_callback() to iterate over all configured DNS nameservers and ping each one until a reply is received.
   - When ip is NULL, use dns_foreach_nameserver() to dynamically resolve and ping DNS servers at runtime, replacing the previous #ifdef CONFIG_NETDB_DNSSERVER_IPv4ADDR compile-time approach.
   - When ip is provided, ping the specified address directly (behavior unchanged).
   - Fix missing newline at end of file.
   
   ## Testing
   Verify netlib_check_ipconnectivity(NULL, ...) pings DNS servers from resolv.conf and ram.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netlib: support checkipconnectivity when use reslov.conf [nuttx-apps]

Posted by "zhhyu7 (via GitHub)" <gi...@apache.org>.
zhhyu7 closed pull request #3460: netlib: support checkipconnectivity when use reslov.conf
URL: https://github.com/apache/nuttx-apps/pull/3460


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netlib: support checkipconnectivity when use reslov.conf [nuttx-apps]

Posted by "zhhyu7 (via GitHub)" <gi...@apache.org>.
zhhyu7 commented on PR #3460:
URL: https://github.com/apache/nuttx-apps/pull/3460#issuecomment-4296675420

   > @zhhyu7 it's not a good method to use ping to check if DNS server is reachable. Here is the reason: A DNS server is only required to answer DNS queries on port 53 over UDP/TCP. Replying to ping means replying to ICMP Echo, which is separate and optional.
   > 
   > So a DNS server may:
   > 
   > * answer DNS normally
   > * ignore or block ping
   > * be behind a firewall that drops ICMP
   > 
   > If you want to test DNS reachability, use a DNS query like nslookup, dig, or host, not ping.
   > 
   > And we need move further: It's not good practice to just check network connectivity via ping ipv4 address, the device may just have an IPv6 address only.
   
   @masc2008, You're right. Regarding NTP, I think we should directly remove the netlib_check_ipconnectivity check from the ntpclient file, because we already have backoff behavior to avoid screen flooding. Meanwhile, I will add a new patch later to select a more appropriate IP address for the check, such as DRaddr, and also add support for IPv6 addresses.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netlib: support checkipconnectivity when use reslov.conf [nuttx-apps]

Posted by "masc2008 (via GitHub)" <gi...@apache.org>.
masc2008 commented on PR #3460:
URL: https://github.com/apache/nuttx-apps/pull/3460#issuecomment-4296440895

   @zhhyu7  it's not a good method to use ping to check if DNS server is reachable.  Here is the reason:
   A DNS server is only required to answer DNS queries on port 53 over UDP/TCP. Replying to ping means replying to ICMP Echo, which is separate and optional.
   
     So a DNS server may:
   
     - answer DNS normally
     - ignore or block ping
     - be behind a firewall that drops ICMP
   
     If you want to test DNS reachability, use a DNS query like nslookup, dig, or host, not ping.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netlib: support checkipconnectivity when use reslov.conf [nuttx-apps]

Posted by "masc2008 (via GitHub)" <gi...@apache.org>.
masc2008 commented on PR #3460:
URL: https://github.com/apache/nuttx-apps/pull/3460#issuecomment-4296756470

   thanks! Good job HongYu!👍
   
   On Wed, 22 Apr 2026 at 21:39, zhhyu7 ***@***.***> wrote:
   
   > *zhhyu7* left a comment (apache/nuttx-apps#3460)
   > <https://github.com/apache/nuttx-apps/pull/3460?email_source=notifications&email_token=AEIQS6OZIYF2Y6WWNXTS7F34XDDRLA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRZGY3DONJUGIYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4296675420>
   >
   > @zhhyu7 <https://github.com/zhhyu7> it's not a good method to use ping to
   > check if DNS server is reachable. Here is the reason: A DNS server is only
   > required to answer DNS queries on port 53 over UDP/TCP. Replying to ping
   > means replying to ICMP Echo, which is separate and optional.
   >
   > So a DNS server may:
   >
   >    - answer DNS normally
   >    - ignore or block ping
   >    - be behind a firewall that drops ICMP
   >
   > If you want to test DNS reachability, use a DNS query like nslookup, dig,
   > or host, not ping.
   >
   > And we need move further: It's not good practice to just check network
   > connectivity via ping ipv4 address, the device may just have an IPv6
   > address only.
   >
   > @masc2008 <https://github.com/masc2008>, You're right. Regarding NTP, I
   > think we should directly remove the netlib_check_ipconnectivity check from
   > the ntpclient file, because we already have backoff behavior to avoid
   > screen flooding. Meanwhile, I will add a new patch later to select a more
   > appropriate IP address for the check, such as DRaddr, and also add support
   > for IPv6 addresses.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/nuttx-apps/pull/3460?email_source=notifications&email_token=AEIQS6OZIYF2Y6WWNXTS7F34XDDRLA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRZGY3DONJUGIYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4296675420>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AEIQS6OGLDI3RFJ5NLGD2ID4XDDRLAVCNFSM6AAAAACYCBRKC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DEOJWGY3TKNBSGA>
   > .
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org