IPv6 support and cleanup of address family dependency in userland utilities
Student: YanHaoWang (yanhaowang@FreeBSD.org)
Mentor: HirokiSato (hrs@FreeBSD.org), LiWenHsu (lwhsu@FreeBSD.org)
Project description
FreeBSD boasts a plethora of userspace command tools utilizing IPv4 network programming APIs and exhibiting address family dependency. With the emergence of IPv6 to address the limitations of IPv4, it's imperative to update these tools to utilize address-independent APIs, thereby facilitating seamless handling of both IPv4 and IPv6 connections.
Approach to solving the problem
- Buil an IPv6-only machine and develop on it.
Replace the use of IPv4-specific functions like gethostby*() with their IPv6-compatible counterparts. For example, getaddrinfo().
- Introduce conditional compilation flags (INET and INET6) to ensure compatibility with both IPv4 and IPv6.
Account for potential scenarios involving IPv6 hostnames with multiple addresses associated with a single hostname. Using the ai_next pointer in struct addrinfo to retrieve all addressee and do the action.
Deliverables
1. Ensure that all command line tools (located in sbin/, usr.sbin/, bin/, and usr.bin/) are updated to support both IPv4 and IPv6 seamlessly, achieving IPv6 cleanliness.
Milestones
Write later after discussing with the mentor.
Test Plan
Conduct thorough testing on an IPv6-only machine to verify the functionality and compatibility of the updated utilities. Consider implementing Automated Testing Framework (ATF) for comprehensive testing coverage.
The Code
Upload later.