Bull GNU/Linux NFSv4 project

IPv6 support for NFS

Download page

March 21th, 2005
Gilles Quillard
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:

libtirpc-0.1.6.tar.bz2
rpcbind-0.1.4.tar.bz2
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:

File linux-2.6.11-01.patch

Move some tests depending on the transport from inode.c to xprtsock.c.

File linux-2.6.11-02.patch

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

With this solution, the space needed to store the address is allocated according to the family of the address. This avoids to use a sockaddr_storage structure with a large unused space.

File linux-2.6.11-03.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.

With this solution, the space needed to store the address is allocated according to the family of the address. This avoids to use a sockaddr_storage structure with a large unused space.

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

File linux-2.6.11-04.patch

Complete the transport dependent functions used to print the addresses: add a raw mode (print only the value without any comment) and add a new display for universal addresses.

Use rpc_print_peeraddr() to display the address information in NFS.

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

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.

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-07.patch

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


Cumulative patch:

File linux-2.6.11-ALL.patch

The complete set of patches combined into one patch.


Page maintained by: Gilles Quillard
Accessed times since its creation.
 
Last update: 2005, March 24