netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why MLDv2 Report packet is freed ?
@ 2008-04-15 13:23 Ian Brown
  2008-04-15 14:48 ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Brown @ 2008-04-15 13:23 UTC (permalink / raw)
  To: netdev, yoshfuji

Hello,

I have a question about the multicast routing support and pim6sd in
this latest tree;

I tried to run pim6sd daemon on a kernel with the latest updates from
the git tree;
and I had also a host with the latest updates from the git tree.
(The  pim6sd is taken from yoshifuji mcast-tools git tree.0

When a host joins a multicast group  a
Multicast Listener Report V2 (MLDV2) is sent. It is of type 143,
which is ICMPV6_MLD2_REPORT. I can see it with a sniffer on the router machine
running pim6sd.

The destination of the MLDv2 report is ff02::16.

Now, I don't understand something here:
I had looked at icmpv6_rcv() in net/ipv6/icmp.c.

I see that when the type of the ICMP packet is ICMPV6_MLD2_REPORT it
is dropped (calling kfree_skb()).

shouldn't it be handled and passed onward so that it will
eventually reach the pim6sd daemon ? or is this
only implemented currently for MLDV1 ?

I want to add that I saw on the machine running pim6sd that
this packet does not reach accept_mld6(). (I added some printing there).

This does not change also with "phyint eth0 mld_version 2" to pim6sd.conf;

Two last notes:
- I had mc_forwarding and forwarding set for IPv6 on the router machine.
- pim6stat shows possible MLD version = 1 on all interfaces (also after
  restarting pim6sd with mld_version 2).

Regards,
IB

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why MLDv2 Report packet is freed ?
  2008-04-15 13:23 Why MLDv2 Report packet is freed ? Ian Brown
@ 2008-04-15 14:48 ` YOSHIFUJI Hideaki / 吉藤英明
  2008-04-16 11:50   ` Ian Brown
  0 siblings, 1 reply; 6+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-04-15 14:48 UTC (permalink / raw)
  To: ianbrn; +Cc: netdev, yoshfuji

In article <d0383f90804150623r2eb071fau200a67c6ce65a7e0@mail.gmail.com> (at Tue, 15 Apr 2008 16:23:33 +0300), "Ian Brown" <ianbrn@gmail.com> says:

> Now, I don't understand something here:
> I had looked at icmpv6_rcv() in net/ipv6/icmp.c.
> 
> I see that when the type of the ICMP packet is ICMPV6_MLD2_REPORT it
> is dropped (calling kfree_skb()).
> 
> shouldn't it be handled and passed onward so that it will
> eventually reach the pim6sd daemon ? or is this
> only implemented currently for MLDV1 ?

In MLDv1, Report suppress other hosts' reports, but 
On the other hand, in MLDv2, Reports does not suppress.
So, MLDv2 Report is useless for in-kernel MLD handler.

MLD packets are handled in other place.

--yoshfuji

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why MLDv2 Report packet is freed ?
  2008-04-15 14:48 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2008-04-16 11:50   ` Ian Brown
  2008-04-16 18:02     ` Brian Haley
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Brown @ 2008-04-16 11:50 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki / 吉藤英明; +Cc: netdev

Hello,

I am sorry, I tried to delve into the code and I not sure I can figure out this
point.
> MLD packets are handled in other place.

Can anybody please try to elaborate on this point: how
are MLD packets handled ? Shouldn't MLD packets be
handled by pim6sd daemon? I see handlers for accepting MLD (v1 and v2)
in pim6sd daemon;
And in case MLD packets  should be handled by pim6sd  - shouldn't the kernel
pass these MLD packets to the pim6sd daemon (by calling sock_queue_rcv_skb()
in ip6mr.c) ? As far as I can understand, these MLD packets are
dropped in icmpv6_rcv()., see my
former post ;

IB

On Tue, Apr 15, 2008 at 5:48 PM, YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@linux-ipv6.org> wrote:
> In article <d0383f90804150623r2eb071fau200a67c6ce65a7e0@mail.gmail.com> (at Tue, 15 Apr 2008 16:23:33 +0300), "Ian Brown" <ianbrn@gmail.com> says:
>
>  > Now, I don't understand something here:
>  > I had looked at icmpv6_rcv() in net/ipv6/icmp.c.
>  >
>  > I see that when the type of the ICMP packet is ICMPV6_MLD2_REPORT it
>  > is dropped (calling kfree_skb()).
>  >
>  > shouldn't it be handled and passed onward so that it will
>  > eventually reach the pim6sd daemon ? or is this
>  > only implemented currently for MLDV1 ?
>
>  In MLDv1, Report suppress other hosts' reports, but
>  On the other hand, in MLDv2, Reports does not suppress.
>  So, MLDv2 Report is useless for in-kernel MLD handler.
>
>  MLD packets are handled in other place.
>
>  --yoshfuji
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why MLDv2 Report packet is freed ?
  2008-04-16 11:50   ` Ian Brown
@ 2008-04-16 18:02     ` Brian Haley
  2008-04-17  5:49       ` Ian Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Brian Haley @ 2008-04-16 18:02 UTC (permalink / raw)
  To: Ian Brown; +Cc: YOSHIFUJI Hideaki / 吉藤英明, netdev

Ian Brown wrote:
> Hello,
> 
> I am sorry, I tried to delve into the code and I not sure I can figure out this
> point.
>> MLD packets are handled in other place.
> 
> Can anybody please try to elaborate on this point: how
> are MLD packets handled ? Shouldn't MLD packets be
> handled by pim6sd daemon?

Yes.

> I see handlers for accepting MLD (v1 and v2)
> in pim6sd daemon;
> And in case MLD packets  should be handled by pim6sd  - shouldn't the kernel
> pass these MLD packets to the pim6sd daemon (by calling sock_queue_rcv_skb()
> in ip6mr.c) ? As far as I can understand, these MLD packets are
> dropped in icmpv6_rcv()

>From what I can tell, ip6_mc_input() makes a copy if multicast routing
is enabled.  Those copies eventually get to ip6mr_cache_report() which
delivers them to user-space (there's even a reference to pim6sd in
net/ipv6/ip6mr.c).

Have you seen them not get delivered?

-Brian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why MLDv2 Report packet is freed ?
  2008-04-16 18:02     ` Brian Haley
@ 2008-04-17  5:49       ` Ian Brown
  2008-04-17 10:11         ` Rami Rosen
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Brown @ 2008-04-17  5:49 UTC (permalink / raw)
  To: Brian Haley; +Cc: YOSHIFUJI Hideaki / 吉藤英明, netdev

Hello,

First, I have multicast routing enabled:
/proc/sys/net/ipv6/conf/*/mc_forwarding is 1 and
CONFIG_IPV6_MROUTE=y when building the kernel.

Second, when MLDV2 report reaches ip6_mc_input(),
the ICMPv6 header has a type of ICMPV6_MLD2_REPORT; and it is a router
alert. This causes a call to ip6_input() and **not** ip6_mr_input().
This casue it to be handled by the ICMPv6 handler, which is icmpv6_rcv().
I am absolutely sure about it, as I added some printk() in these kernel methods.
I see that I reach the icmpv6_rcv() and the packet is dropped.
The sock_queue_rcv_skb() method in p6mr_cache_report() is NOT called
in this case -
simply because we don't get there, since ip6_mc_input() in this case
does **not**
call ip6_mr_input() ; it does call ip6_mr_input() in other cases.

Moreover, I added printing in the accept_mld6() method of the pim6sd
daemon, which is the
handler for these packets, and I do not get there.

Could it be that this is a bug ?

Any ideas ?

IB





On Wed, Apr 16, 2008 at 9:02 PM, Brian Haley <brian.haley@hp.com> wrote:
> Ian Brown wrote:
>  > Hello,
>  >
>  > I am sorry, I tried to delve into the code and I not sure I can figure out this
>  > point.
>  >> MLD packets are handled in other place.
>  >
>  > Can anybody please try to elaborate on this point: how
>  > are MLD packets handled ? Shouldn't MLD packets be
>  > handled by pim6sd daemon?
>
>  Yes.
>
>
>  > I see handlers for accepting MLD (v1 and v2)
>  > in pim6sd daemon;
>  > And in case MLD packets  should be handled by pim6sd  - shouldn't the kernel
>  > pass these MLD packets to the pim6sd daemon (by calling sock_queue_rcv_skb()
>  > in ip6mr.c) ? As far as I can understand, these MLD packets are
>  > dropped in icmpv6_rcv()
>
>  From what I can tell, ip6_mc_input() makes a copy if multicast routing
>  is enabled.  Those copies eventually get to ip6mr_cache_report() which
>  delivers them to user-space (there's even a reference to pim6sd in
>  net/ipv6/ip6mr.c).
>
>  Have you seen them not get delivered?
>
>  -Brian
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why MLDv2 Report packet is freed ?
  2008-04-17  5:49       ` Ian Brown
@ 2008-04-17 10:11         ` Rami Rosen
  0 siblings, 0 replies; 6+ messages in thread
From: Rami Rosen @ 2008-04-17 10:11 UTC (permalink / raw)
  To: Ian Brown
  Cc: Brian Haley, YOSHIFUJI Hideaki / 吉藤英明,
	netdev

Hi,

What happens here is this:

>Second, when MLDV2 report reaches ip6_mc_input(),
>the ICMPv6 header has a type of ICMPV6_MLD2_REPORT; and it is a router
>alert. This causes a call to ip6_input() and **not** ip6_mr_input().
>This cause it to be handled by the ICMPv6 handler, which is icmpv6_rcv().
>I am absolutely sure about it, as I added some printk() in these
kernel methods.
>I see that I reach the icmpv6_rcv() and the packet is dropped.

All this is correct. But **before** it reaches the icmpv6_rcv(), what
happens is this:
The ip6_input() method calls ip6_input_finish(), which calls
raw6_local_deliver(). The skb is cloned in ipv6_raw_deliver().
Eventually, rawv6_rcv_skb() delivers the packet to
user space by calling sock_queue_rcv_skb(). (see net/ipv6/raw.c).
Subsequently, it continues to icmpv6_rcv() and frees the packet since its
type is ICMPV6_MLD2_REPORT.



>The sock_queue_rcv_skb() method in p6mr_cache_report() is NOT called
>in this case -
>simply because we don't get there, since ip6_mc_input() in this case

True. The packet is passed to the pim6sd user space daemon by the
rawv6_rcv_skb()
, as mentioned above.
In this implementation, the sock_queue_rcv_skb() in p6mr_cache_report()
is not for MLDv2 REPORT messages, but for other type of messages.

Regards,
Rami Rosen





On Thu, Apr 17, 2008 at 8:49 AM, Ian Brown <ianbrn@gmail.com> wrote:
> Hello,
>
>  First, I have multicast routing enabled:
>  /proc/sys/net/ipv6/conf/*/mc_forwarding is 1 and
>  CONFIG_IPV6_MROUTE=y when building the kernel.
>
>  Second, when MLDV2 report reaches ip6_mc_input(),
>  the ICMPv6 header has a type of ICMPV6_MLD2_REPORT; and it is a router
>  alert. This causes a call to ip6_input() and **not** ip6_mr_input().
>  This casue it to be handled by the ICMPv6 handler, which is icmpv6_rcv().
>  I am absolutely sure about it, as I added some printk() in these kernel methods.
>  I see that I reach the icmpv6_rcv() and the packet is dropped.
>  The sock_queue_rcv_skb() method in p6mr_cache_report() is NOT called
>  in this case -
>  simply because we don't get there, since ip6_mc_input() in this case
>  does **not**
>  call ip6_mr_input() ; it does call ip6_mr_input() in other cases.
>
>  Moreover, I added printing in the accept_mld6() method of the pim6sd
>  daemon, which is the
>  handler for these packets, and I do not get there.
>
>  Could it be that this is a bug ?
>
>  Any ideas ?
>
>  IB
>
>
>
>
>
>
>
>  On Wed, Apr 16, 2008 at 9:02 PM, Brian Haley <brian.haley@hp.com> wrote:
>  > Ian Brown wrote:
>  >  > Hello,
>  >  >
>  >  > I am sorry, I tried to delve into the code and I not sure I can figure out this
>  >  > point.
>  >  >> MLD packets are handled in other place.
>  >  >
>  >  > Can anybody please try to elaborate on this point: how
>  >  > are MLD packets handled ? Shouldn't MLD packets be
>  >  > handled by pim6sd daemon?
>  >
>  >  Yes.
>  >
>  >
>  >  > I see handlers for accepting MLD (v1 and v2)
>  >  > in pim6sd daemon;
>  >  > And in case MLD packets  should be handled by pim6sd  - shouldn't the kernel
>  >  > pass these MLD packets to the pim6sd daemon (by calling sock_queue_rcv_skb()
>  >  > in ip6mr.c) ? As far as I can understand, these MLD packets are
>  >  > dropped in icmpv6_rcv()
>  >
>  >  From what I can tell, ip6_mc_input() makes a copy if multicast routing
>  >  is enabled.  Those copies eventually get to ip6mr_cache_report() which
>  >  delivers them to user-space (there's even a reference to pim6sd in
>  >  net/ipv6/ip6mr.c).
>  >
>  >  Have you seen them not get delivered?
>  >
>  >  -Brian
>  >
>  --
>  To unsubscribe from this list: send the line "unsubscribe netdev" in
>  the body of a message to majordomo@vger.kernel.org
>  More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-04-17 10:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-15 13:23 Why MLDv2 Report packet is freed ? Ian Brown
2008-04-15 14:48 ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-16 11:50   ` Ian Brown
2008-04-16 18:02     ` Brian Haley
2008-04-17  5:49       ` Ian Brown
2008-04-17 10:11         ` Rami Rosen

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).