* [PATCH 2/2]IPv6: Fix the data length of get destination options with short length
@ 2008-05-28 8:27 Yang Hongyang
0 siblings, 0 replies; only message in thread
From: Yang Hongyang @ 2008-05-28 8:27 UTC (permalink / raw)
To: yoshfuji; +Cc: davem, netdev
If get destination options with length which is not enough for that
option,getsockopt() will still return the real length of the option,
which is larger then the buffer space.
This is because ipv6_getsockopt_sticky() returns the real length of
the option.
This patch fix this problem.
Signed-off-by: Yang Hongyang <yanghy@cn•fujitsu.com>
---
net/ipv6/ipv6_sockglue.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index aa7bedf..9293b9f 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -832,7 +832,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
len = min_t(unsigned int, len, ipv6_optlen(hdr));
if (copy_to_user(optval, hdr, len))
return -EFAULT;
- return ipv6_optlen(hdr);
+ return len;
}
static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
--
1.5.3.8
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-05-28 8:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 8:27 [PATCH 2/2]IPv6: Fix the data length of get destination options with short length Yang Hongyang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox