From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
Cc: davem@sunset.davemloft.net,
FNST-Wei Yongjun <yjwei@cn.fujitsu.com>,
netdev@vger.kernel.org, Wang Chen <wangchen@cn.fujitsu.com>
Subject: Re: [PATCH] IPv6: Fix the data length of get destination options with short length
Date: Thu, 29 May 2008 10:29:47 +0800 [thread overview]
Message-ID: <483E151B.2000804@cn.fujitsu.com> (raw)
In-Reply-To: <20080528.201322.26342915.yoshfuji@linux-ipv6.org>
YOSHIFUJI Hideaki / 吉藤英明 wrote:
> POSIX says that the object pointed to by the option_len argument shall be
> modified to indicate the actual length of the value.
> Do you think this change conforms to the spec?
>
We use the codes below to get the destination options,the length cnt is half of the option length.
cnt = sizeof(incmsg) / 2;
if (getsockopt(sk, IPPROTO_IPV6, IPV6_DSTOPTS,
(char *)incmsg, &cnt) == -1)
We can see from net/ipv6/ipv6_sockglue.c,the code below store half of the option length to incmsg,
so the acture data length of incmsg is half of the option length.According to RFC(as you said
"option_len argument shall be modified to indicate the actual length of the value") the cnt
should specify the data length of incmsg,that is half of the option length.So we should return len
instead of ipv6_optlen(hdr).
832 len = min_t(unsigned int, len, ipv6_optlen(hdr));
833 if (copy_to_user(optval, hdr, len))
834 return -EFAULT;
--
Regards
Yang Hongyang
A new email address of FJWAN is launched from Apr.1 2007.
The updated address is: yanghy@cn.fujitsu.com
--------------------------------------------------
Yang Hongyang
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
8/F., Civil Defense Building, No.189 Guangzhou Road,
Nanjing, 210029, China
TEL: +86+25-86630566-812
FUJITSU INTERNAL: 79955-812
FAX: +86+25-83317685
EMAIL: yanghy@cn.fujitsu.com
--------------------------------------------------
This communication is for use by the intended recipient(s) only and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not an intended recipient of this communication, you are hereby notified that any dissemination, distribution or copying hereof is strictly prohibited. If you have received this communication in error, please notify me by reply e-mail, permanently delete this communication from your system, and destroy any hard copies you may have printed
next prev parent reply other threads:[~2008-05-29 2:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-28 6:49 [PATCH] IPv6: Fix the data length of get destination options with short length Yang Hongyang
2008-05-28 6:54 ` Wang Chen
2008-05-28 7:06 ` Yang Hongyang
2008-05-28 11:13 ` YOSHIFUJI Hideaki / 吉藤英明
2008-05-29 1:29 ` Yang Hongyang
2008-05-29 2:29 ` Yang Hongyang [this message]
2008-05-29 8:42 ` YOSHIFUJI Hideaki / 吉藤英明
-- strict thread matches above, loose matches on Subject: below --
2008-05-28 7:15 Yang Hongyang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=483E151B.2000804@cn.fujitsu.com \
--to=yanghy@cn.fujitsu.com \
--cc=davem@sunset.davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=wangchen@cn.fujitsu.com \
--cc=yjwei@cn.fujitsu.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).