net: ipv6: fix wrong ping_v6_sendmsg return value
Lorenzo Colitti [Wed, 3 Jul 2013 15:12:40 +0000 (00:12 +0900)]
ping_v6_sendmsg currently returns 0 on success. It should return
the number of bytes written instead.

Bug: 9469865
Bug 1412141
Change-Id: I14aad6018f0c3fd92dad315bc3ade04c0b3982e0
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5f0fd6105f491b8b435863e98f7e96d617e3da84)
Reviewed-on: http://git-master/r/336272
GVS: Gerrit_Virtual_Submit
Reviewed-by: Om Prakash Singh <omp@nvidia.com>
Tested-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: http://git-master/r/337767

net/ipv6/ping.c

index 9ca1f1a..858788d 100644 (file)
@@ -214,5 +214,8 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
        }
        release_sock(sk);
 
-       return err;
+       if (err)
+               return err;
+
+       return len;
 }