mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
net: sunrpc: interpret the return value of kstrtou32 correctly
commit86b53fbf08
upstream. A return value of 0 means success. This is documented in lib/kstrtox.c. This was found by trying to mount an NFS share from a link-local IPv6 address with the interface specified by its index: mount("[fe80::1%1]:/srv/nfs", "/mnt", "nfs", 0, "nolock,addr=fe80::1%1") Before this commit this failed with EINVAL and also caused the following message in dmesg: [...] NFS: bad IP address specified: addr=fe80::1%1 The syscall using the same address based on the interface name instead of its index succeeds. Credits for this patch go to my colleague Christian Speich, who traced the origin of this bug to this line of code. Signed-off-by: Johannes Nixdorf <j.nixdorf@avm.de> Fixes:00cfaa943e
("replace strict_strto calls") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
21a466aed7
commit
f6ced16ce5
1 changed files with 1 additions and 1 deletions
|
@ -184,7 +184,7 @@ static int rpc_parse_scope_id(struct net *net, const char *buf,
|
|||
scope_id = dev->ifindex;
|
||||
dev_put(dev);
|
||||
} else {
|
||||
if (kstrtou32(p, 10, &scope_id) == 0) {
|
||||
if (kstrtou32(p, 10, &scope_id) != 0) {
|
||||
kfree(p);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue