]> git.baikalelectronics.ru Git - kernel.git/commit
[IPV6]: Fix the return value of get destination options with NULL data pointer
authorYang Hongyang <yanghy@cn.fujitsu.com>
Wed, 28 May 2008 08:23:47 +0000 (16:23 +0800)
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Wed, 4 Jun 2008 19:02:34 +0000 (04:02 +0900)
commit72cbf3b7fd812cee06a644b35464000b17b45783
treefadca5b01e5029eaef277f691c9f4d78a54c0bad
parent7fc3ada2ceac76d00687e4e0ce191c2f7e8394cf
[IPV6]: Fix the return value of get destination options with NULL data pointer

If we pass NULL data buffer to getsockopt(), it will return 0,
and the option length is set to -EFAULT:
    getsockopt(sk, IPPROTO_IPV6, IPV6_DSTOPTS, NULL, &len);

This is because ipv6_getsockopt_sticky() will return -EFAULT or
-EINVAL if some error occur.

This patch fix this problem.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
net/ipv6/ipv6_sockglue.c