net: ipv6: fix wrong ping_v6_sendmsg return value
authorLorenzo Colitti <lorenzo@google.com>
Wed, 3 Jul 2013 15:12:40 +0000 (00:12 +0900)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Jul 2013 00:42:05 +0000 (17:42 -0700)
ping_v6_sendmsg currently returns 0 on success. It should return
the number of bytes written instead.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ping.c

index 10b9755..18f19df 100644 (file)
@@ -191,7 +191,10 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
        }
        release_sock(sk);
 
-       return err;
+       if (err)
+               return err;
+
+       return len;
 }
 
 #ifdef CONFIG_PROC_FS