From: Jason Wang <jasowang@redhat.com>
To: Alexis Dambricourt <alexis.dambricourt@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] l2tpv3: fix cookie decoding
Date: Wed, 6 Jan 2016 11:01:23 +0800 [thread overview]
Message-ID: <568C8383.3010903@redhat.com> (raw)
In-Reply-To: <1451949967-30272-1-git-send-email-alexis.dambricourt@gmail.com>
On 01/05/2016 07:26 AM, Alexis Dambricourt wrote:
> If a 32 bits l2tpv3 frame cookie MSB if set to 1, the cast to uint64_t
> cookie will spread 1 to the four most significant bytes.
> Then the condition (cookie != s->rx_cookie) becomes false.
>
> Signed-off-by: Alexis Dambricourt <alexis.dambricourt@gmail.com>
> ---
> net/l2tpv3.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/l2tpv3.c b/net/l2tpv3.c
> index 8e68e54..21d6119 100644
> --- a/net/l2tpv3.c
> +++ b/net/l2tpv3.c
> @@ -325,7 +325,7 @@ static int l2tpv3_verify_header(NetL2TPV3State *s, uint8_t *buf)
> if (s->cookie_is_64) {
> cookie = ldq_be_p(buf + s->cookie_offset);
> } else {
> - cookie = ldl_be_p(buf + s->cookie_offset);
> + cookie = ldl_be_p(buf + s->cookie_offset) & 0xffffffffULL;
> }
> if (cookie != s->rx_cookie) {
> if (!s->header_mismatch) {
Applied to my -net.
Thanks
prev parent reply other threads:[~2016-01-06 3:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-04 23:26 [Qemu-devel] [PATCH v2] l2tpv3: fix cookie decoding Alexis Dambricourt
2016-01-06 3:01 ` Jason Wang [this message]
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=568C8383.3010903@redhat.com \
--to=jasowang@redhat.com \
--cc=alexis.dambricourt@gmail.com \
--cc=qemu-devel@nongnu.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).