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
- 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.
- Live test all the command tools I revised.
Milestones
- Write the utilities for both easy and medium levels before the Mid Term Evaluation (July 8 - July 12).
- Complete writing all utilities before the End Term Evaluation (August 26).
Weekly report
Date |
Week |
|
5/27 - 6/6 |
||
6/7 - 6/14 |
||
6/15 - 6/28 |
||
6/29 - 7/11 |
||
7/12 - 7/19 |
||
7/20 - 8/2 |
||
8/3 - 8/21 |
Test Plan
I have conducted live tests on all the patches I revised in the code section. For instance, I simulated RARP packets to test the rarpd(1) patch and simulated a server and client for RPC programs like rup(1). The testing methods are detailed in the patch test section.
The Code
Utility |
Patch |
Description |
||
rwhod(8) |
Add IPv6 support to let rwhod can host on ipv6 address. |
|||
ypbind(8) |
Add version 3 of ypbind from Sun. Add a new structure to represent the IPv4/6 address so that ypbind can work with ipv6. Also, revise version 2 of ypbind to use TI-RPC function instead of TS-RPC function. |
|||
arp(8) |
Remove gethostby*() calls. |
|||
ppp(8) |
Remove gethostby*() calls. |
|||
systat(1) |
Remove gethostby*() calls. |
|||
rarpd(1) |
Remove gethostby*() calls. |
|||
traceroute(8) |
Remove gethostby*() calls. |
|||
netstat(1) |
Remove gethostby*() calls. |
|||
getent(1) |
Remove gethostby*() calls. |
|||
rusers(1) |
Add version 3 of rusers from Sun which can let rusers work on IPv6. |
|||
rup(1) |
Add version 4 of rup from Sun which can let rup work on IPv6. |
|||
rpc.rquotad(8) |
Add version 4 of rpc.rquotad from Sun which can let rup work on IPv6. |