All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: network dev <netdev@vger.kernel.org>, David Miller <davem@davemloft.net>
Subject: Re: [PATCH net] ipv6: Fix MLD Query message check
Date: Wed, 25 Jun 2014 09:29:16 +0800	[thread overview]
Message-ID: <CAPwn2JTqGH_iBVxXYY4m4x4b2LiOtvO4y0-9YH-aq3T2SidVwQ@mail.gmail.com> (raw)
In-Reply-To: <53A98AC1.3010107@cogentembedded.com>

2014-06-24 22:27 GMT+08:00 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:
> Hello.
>
>
> On 06/24/2014 03:50 PM, Hangbin Liu wrote:
>
>> Based on RFC3810 6.2, we also need to check the hop limit and router alert
>> option besides source address.
>
>
>> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
>> ---
>>   net/ipv6/mcast.c | 14 ++++++++++++--
>>   1 file changed, 12 insertions(+), 2 deletions(-)
>
>
>> diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
>> index 08b367c..fdf7455 100644
>> --- a/net/ipv6/mcast.c
>> +++ b/net/ipv6/mcast.c
>> @@ -1301,8 +1301,18 @@ int igmp6_event_query(struct sk_buff *skb)
>>         len = ntohs(ipv6_hdr(skb)->payload_len) + sizeof(struct ipv6hdr);
>>         len -= skb_network_header_len(skb);
>>
>> -       /* Drop queries with not link local source */
>> -       if (!(ipv6_addr_type(&ipv6_hdr(skb)->saddr) &
>> IPV6_ADDR_LINKLOCAL))
>> +       /* RFC3810 6.2
>> +        * Upon reception of an MLD message that contains a Query, the
>> node
>> +        * checks if the source address of the message is a valid
>> link-local
>> +        * address, if the Hop Limit is set to 1, and if the Router Alert
>> +        * option is present in the Hop-By-Hop Options header of the IPv6
>> +        * packet.  If any of these checks fails, the packet is dropped.
>> +        */
>> +       if (!(ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL)
>> ||
>> +                       ipv6_hdr(skb)->hop_limit != 1 ||
>> +                       ipv6_hdr(skb)->nexthdr != NEXTHDR_HOP ||
>> +                       !(IP6CB(skb)->flags & IP6SKB_ROUTERALERT) ||
>> +                       IP6CB(skb)->ra != htons(IPV6_OPT_ROUTERALERT_MLD))
>
>
>    The continuation lines should start exactly under '!' on the broken up
> line.

Ah, thanks for the reminder. I will send a patch v2 later.

Best Regards
Hangbin Liu
>
> WBR, Sergei
>

      reply	other threads:[~2014-06-25  1:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 11:50 [PATCH net] ipv6: Fix MLD Query message check Hangbin Liu
2014-06-24 14:27 ` Sergei Shtylyov
2014-06-25  1:29   ` Hangbin Liu [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=CAPwn2JTqGH_iBVxXYY4m4x4b2LiOtvO4y0-9YH-aq3T2SidVwQ@mail.gmail.com \
    --to=liuhangbin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.