Skip to contentSkip to conversation

fix broken handling of port=... in NFS option parsing

PATCH In review Al Viro 3 participants 3 messages Jul 22, 2007 – Jul 23, 2007 NFS client

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 fix broken handling of port=... in NFS option parsing

Obviously broken on little-endian; fortunately, the option is
not frequently used...

---

fs/nfs/super.c +1 -1
index b34b7a7..b2a851c 100644
@@ -732,7 +732,7 @@ static int nfs_parse_mount_options(char *raw,
 				return 0;
 			if (option < 0 || option > 65535)
 				return 0;
-			mnt->nfs_server.address.sin_port = htonl(option);
+			mnt->nfs_server.address.sin_port = htons(option);
 			break;
 		case Opt_rsize:
 			if (match_int(args, &mnt->rsize))
#1 lore raw
Quoted 10 lines · Al Viro

Obviously broken on little-endian; fortunately, the option is
not frequently used...

---

fs/nfs/super.c +0 -0
index b34b7a7..b2a851c 100644

fs/nfs/super.c static int nfs_parse_mount_options(char *raw, · line 738

Quoted 8 lines
fs/nfs/super.c +1 -1
@@ -732,7 +732,7 @@ static int nfs_parse_mount_options(char *raw,
 				return 0;
 			if (option < 0 || option > 65535)
 				return 0;
-			mnt->nfs_server.address.sin_port = htonl(option);
+			mnt->nfs_server.address.sin_port = htons(option);
 			break;
 		case Opt_rsize:
 			if (match_int(args, &mnt->rsize))

ACK. Thanks Al!

Trond

#2 lore raw
In reply to Al Viro

ACK.

Quoted 10 lines · Al Viro

Obviously broken on little-endian; fortunately, the option is
not frequently used...

---

fs/nfs/super.c +0 -0
index b34b7a7..b2a851c 100644

fs/nfs/super.c static int nfs_parse_mount_options(char *raw, · line 738

Quoted 8 lines
fs/nfs/super.c +1 -1
@@ -732,7 +732,7 @@ static int nfs_parse_mount_options(char *raw,
 				return 0;
 			if (option < 0 || option > 65535)
 				return 0;
-			mnt->nfs_server.address.sin_port = htonl(option);
+			mnt->nfs_server.address.sin_port = htons(option);
 			break;
 		case Opt_rsize:
 			if (match_int(args, &mnt->rsize))

begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard