Skip to content

lwip: Support family specification in getaddrinfo. #17446

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

greezybacon
Copy link
Contributor

Summary

socket.getaddrinfo() supports the specification of an address family; however, the LwIP implementation does not use it. This change allows the application to specify the address family request in DNS resolution. If no family is specified, it falls back to the default preference configured with network.ipconfig().

Testing

I've done some minimal testing on this using an RP2040 and a Wiznet W5100S. It works as expected and returns the address of the family requested. For example:

>>> import socket
>>> socket.getaddrinfo('www.google.com', 80)
[(2, 1, 0, '', ('216.239.38.120', 80))]
>>> socket.getaddrinfo('www.google.com', 80, socket.AF_INET6)
[(2, 1, 0, '', ('2001:4860:4802:32::78', 80))]
>>> socket.getaddrinfo('www.google.com', 80, socket.AF_INET)
[(2, 1, 0, '', ('216.239.38.120', 80))]

Copy link

codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.44%. Comparing base (52ca826) to head (a064572).
Report is 382 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17446      +/-   ##
==========================================
- Coverage   98.54%   98.44%   -0.10%     
==========================================
  Files         169      171       +2     
  Lines       21889    22208     +319     
==========================================
+ Hits        21570    21863     +293     
- Misses        319      345      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

github-actions bot commented Jun 6, 2025

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:   +16 +0.002% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@dpgeorge dpgeorge added the extmod Relates to extmod/ directory in source label Jun 16, 2025
socket.getaddrinfo() supports the specification of an address family;
however, the LwIP implementation does not use it. This change allows the
application to specify the address family request in DNS resolution. If
no family is specified, it falls back to the default preference
configured with network.ipconfig().

Signed-off-by: Jared Hancock <jared.hancock@centeredsolutions.com>
@greezybacon greezybacon force-pushed the feature/lwip-getaddrinfo-inet6 branch from a9f009b to a064572 Compare July 18, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extmod Relates to extmod/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy