Skip to contentSkip to conversation

nfs: Fix nfs_sockaddr_match_ipaddr6

nfs Ben Greear 2 participants 4 messages Sep 3, 2010

Subsystems (2)
lore
Share & tools
lore

Ben Greear

author
#0 lore raw

A typo caused this method not not actually compare the two addresses passed in. It returned true in almost all cases instead.

---
:100644 100644 4e7df2a... e734072... M fs/nfs/client.c

 fs/nfs/client.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/client.c +1 -1
index 4e7df2a..e734072 100644
@@ -275,7 +275,7 @@ static int nfs_sockaddr_match_ipaddr6(const struct sockaddr *sa1,
 	    sin1->sin6_scope_id != sin2->sin6_scope_id)
 		return 0;
 
-	return ipv6_addr_equal(&sin1->sin6_addr, &sin1->sin6_addr);
+	return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr);
 }
 #else	/* !defined(CONFIG_IPV6) && !defined(CONFIG_IPV6_MODULE) */
 static int nfs_sockaddr_match_ipaddr6(const struct sockaddr *sa1,
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 32 lines · Ben Greear

A typo caused this method not not actually compare the two addresses passed in. It returned true in almost all cases instead.

From the perspective of the local logic, that looks correct. Have you tried this with IPv6 mounts? Notice any overall changes in behavior?

---
:100644 100644 4e7df2a... e734072... M fs/nfs/client.c
fs/nfs/client.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/client.c +1 -1
index 4e7df2a..e734072 100644
@@ -275,7 +275,7 @@ static int nfs_sockaddr_match_ipaddr6(const struct sockaddr *sa1,
 	    sin1->sin6_scope_id != sin2->sin6_scope_id)
 		return 0;
 
-	return ipv6_addr_equal(&sin1->sin6_addr, &sin1->sin6_addr);
+	return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr);
 }
 #else	/* !defined(CONFIG_IPV6) && !defined(CONFIG_IPV6_MODULE) */
 static int nfs_sockaddr_match_ipaddr6(const struct sockaddr *sa1,
Signature · 6 lines
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 1 line
chuck[dot]lever[at]oracle[dot]com
author
#2 lore raw
Quoted 8 lines · Chuck Lever
Quoted 3 lines · Ben Greear

A typo caused this method not not actually compare the two addresses passed in. It returned true in almost all cases instead.

From the perspective of the local logic, that looks correct. Have you tried this with IPv6 mounts? Notice any overall changes in behavior?

I noticed this when getting multiple NFS mounts to work with srcaddr=

The change fixed the problems I was seeing, but I haven't tested w/out srcaddr= logic. Might need to have two different NFS servers to do a good test of this logic, and I'm not looking forward to setting up another open-solaris box!

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
Reviewed-by
#3 lore raw
Quoted 8 lines · Ben Greear
Quoted 7 lines · Chuck Lever
Quoted 3 lines · Ben Greear

A typo caused this method not not actually compare the two addresses passed in. It returned true in almost all cases instead.

Quoted 8 lines
Quoted 1 line

From the perspective of the local logic, that looks correct. Have you tried this with IPv6 mounts? Notice any overall changes in behavior?

I noticed this when getting multiple NFS mounts to work with srcaddr=

The change fixed the problems I was seeing, but I haven't tested w/out srcaddr= logic. Might need to have two different NFS servers to do a good test of this logic, and I'm not looking forward to setting up another open-solaris box!

OK, so at least it doesn't seem to break anything. :^)

Signature · 1 line
chuck[dot]lever[at]oracle[dot]com