Skip to contentSkip to conversation

mount: Set protocol family properly for "udp" and "tcp"

PATCH In review Chuck Lever 2 participants 2 messages Feb 16, 2010 – Feb 18, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mount: Set protocol family properly for "udp" and "tcp"

In nfs_nfs_proto_family(), *family is never set if the legacy "udp" or "tcp" mount options are specified. The result is an error message at umount time, for example:

umount.nfs: DNS resolution failed for
2001:5c0:1101:2f00:250:8dff:fe95:5c61: ai_family not supported

even if mount was built with IPv6 support.

The man page says that "udp" is a synonym for "proto=udp", and likewise for "tcp". Thus, we don't look at config_default_family here, but always use AF_INET explicitly, to be consistent with the meaning of proto=.

---

 utils/mount/network.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
utils/mount/network.c +2 -1
index f020933..8dc183a 100644
@@ -1373,8 +1373,9 @@ int nfs_nfs_proto_family(struct mount_options *options,
 
 	switch (po_rightmost(options, nfs_transport_opttbl)) {
 	case 0:	/* udp */
-		return 1;
 	case 1: /* tcp */
+		/* for compatibility; these are always AF_INET */
+		*family = AF_INET;
 		return 1;
 	case 2: /* proto */
 		option = po_get(options, "proto");

A message that is not in the archive (sent off-list or not yet received): 20100216221010.2977.6043.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

#2 lore raw
Quoted 9 lines · Chuck Lever

In nfs_nfs_proto_family(), *family is never set if the legacy "udp" or "tcp" mount options are specified. The result is an error message at umount time, for example:

umount.nfs: DNS resolution failed for
2001:5c0:1101:2f00:250:8dff:fe95:5c61: ai_family not supported

even if mount was built with IPv6 support.

Quoted 8 lines

The man page says that "udp" is a synonym for "proto=udp", and likewise for "tcp". Thus, we don't look at config_default_family here, but always use AF_INET explicitly, to be consistent with the meaning of proto=.

---

Committed...

steved.