Bull GNU/Linux NFSv4 project

IPv6 support for NFS

Download page

May 26th, 2005
Aurélien Charbon

Introduction:

This page provides patches and packages allowing the support of NFS (v2, v3 and v4) over IPv6. This includes :

The current kernel patches are over a linux-2.6.11 kernel release on which the CITI's patches and the Chuck Lever's transport switch patches have been applied (see below).

The TI-RPC library and the rpcbind command have been ported from FreeBSD, and are currently provided as standalone packaging. The question of knowing how these new libraries and command could be delivered is open (standalone packaging, included in other packagings,...).

Note Well:


Available patches and packages:

Kernel part:

The current kernel patch set allows the support of IPv6 in the client side. These patches are available either in separate patches or in a cumulative patch.
Please report problems to Gilles Quillard or Aurelien Charbon.

These patches have to be applied over a linux-2.6.11 on which the CITI's patches and the Chuck Lever's patches, providing the support of advanced transport technologies, have been applied respectively.

Refer to the Chuck Lever's Release Notes for more information about these patches.

User part:

Last release of TI-RPC
libtirpc-0.1.7.tar.bz2
rpcbind-0.1.4.tar.bz2
Util-linux package (contains NFS client commands) util-linux-2.12-3-01.patch applied over util-linux-2.12 on which the CITI's patch have been applied.

The libtirpc and rpcbind packages provide respectively the TI-RPC library and the rpcbind/rpcinfo commands. To install them, unpack the tar files, and follow the instructions in the INSTALL file.

Tests done:


Separative patchset for the client part:

File linux-2.6.11-01.patch

Change structures and tests depending on the transport in inode.c Change transport-dependant field (sockaddr_in) of structure nfs_server
(sockaddr* + length)

File linux-2.6.11-02.patch

Change the client address in the 'struct nfs4_client' to be transport independent. The type of the 'cl_addr' field is changed from sockaddr_in to sockaddr *.
A 'addrlen' field is added to contain the length of the address.

Adapt the prototypage of the nfs4_find_client() and nfs4_get_client().

File linux-2.6.11-03.patch

Complete the transport dependent functions used to print the addresses
Use rpc_print_peeraddr() to display the address information in NFS.

File linux-2.6.11-04.patch

Currently the kernel RPC implements only the portmap (v2) to register/unregister a program and to get the port of a program. Some implementations don't support the portmap (replaced by the rpcbind) with new transports such as IPv6. So at least the getaddr function of the rpcbind has to be supported.
Since there is no mean to know which version of the portmapper is available on the remote machine, we have to try one and, if this fails with an mismatch version error, retry the other one. The bind_idx is an index on the binding function to use is an array of available binding function.
To limit the duplication of code, and to increase the maintainability, pmap_getport6() has been suppressed. pmap_getport() is called for both IPv4 and IPv6 protocols but pmap_create() or pmap_create6() is called according to the address family.

File linux-2.6.11-05.patch

Change the interface with the mount command for NFSv2 and v3 in order to allow the use of non-IPv4 addresses.
The 'nfs_mount_data' structure is extended with the fields host_addrlen (int) and host_addr (sockaddr *) to carry addresses which may be other than IPv4 addresses. The mount version number is incremented to 7 to assume the compatibility with previous versions. So according to the mount version, the server address will be retrieved from the addr or host_addr field.

File linux-2.6.11-06.patch

Change the address format from sockaddr_in to sockaddr_storage to be transport independant. Can be divided into smaller patches:
Patch linux-2.6.11-06a.patch: Introducing two function: svc_getaddlen and svc_get_port to obtain address length and port of a given sockaddr
Patch linux-2.6.11-06b.patch: Define new function is_valid_addr two determine if an adress is valid
Patch linux-2.6.11-06c.patch: Introduce a function to print addresses regardless the transport
Patch linux-2.6.11-06d.patch: Introduce constant MAX_ADDR_BUF which is the max length for an adress buffer. Add addrbuf: address buffer to store all type of addresses
Patch linux-2.6.11-06e.patch: Changing the rq_addr field of svc_rqst structure to become transport-independant
Patch linux-2.6.11-06f.patch: Changing the rq_daddr field of svc_rqst structure to become transport-independant
Patch linux-2.6.11-06g.patch: Changing the addr field from of svc_deferred_req structure to become transport-independant
Patch linux-2.6.11-06h.patch: Changing the svc_tcp_accept to accept other protocol than IPv4
Patch linux-2.6.11-06i.patch: Changing pktinfo structure to be transport-independant
Patch linux-2.6.11-06j.patch: Changing the svc_create_socket_parameter prototype

File linux-2.6.11-07.patch

Adding macros used to manipulate IPv6 addreses (IPv6 mapping, loopback etc.)

File linux-2.6.11-08.patch

Change the callback address in the nfs4_client and nfs4_setclientid structures to be usable by any transport. Adapt the constants for the XDR encoding/decodind

File linux-2.6.11-09.patch

Adding SOCK_PMAP_REG and SOCK_PERM flags
SOCK_PERM flag has been introduced to avoid callback connections to be registered in rpcbind
SOCK_PMAP_REG replaces the pmap_register flag.

Cumulative patch:

File linux-2.6.11-ALL.patch


Page maintained by: Aurelien Charbon
Accessed times since its creation.
 
Last update: 2005, June 06