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 10b975577e91ac872a399a7d7a5dec0a507d4818..18f19df4189f19734564b5fcfbd46ec22b67a1e8 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