On Wed, Jun 18, 2014 at 12:53:20PM +0800, Marek Lindner wrote:
Thanks for the clarifications but that does not address my question. To be more precise: In batadv_mcast_mla_update() your code is calling batadv_mcast_mla_softif_get() which queries the bridge interface (if bridged). A couple of lines later batadv_mcast_mla_bridge_get() is called (if bridged). It looks to me the code queries the bridge twice ?
Then, I am comparing the kernel doc to get the difference but I see none:
- batadv_mcast_mla_softif_get - get softif multicast listeners
- @dev: the device to collect multicast addresses from
- @mcast_list: a list to put found addresses into
- Collect multicast addresses of the local multicast listeners
- on the given soft interface, dev, in the given mcast_list.
- If there is a bridge interface on top of dev, collect from that one
- instead.
===============================================================
- batadv_mcast_mla_bridge_get - get bridged-in multicast listeners
- @dev: a bridge slave whose bridge to collect multicast addresses from
- @mcast_list: a list to put found addresses into
- Collects multicast addresses of the bridged-in multicast listeners
- from the bridge on top of the given soft interface, dev, in the
- given mcast_list.
What is the difference between these calls and why doesn't the code explain that difference ?
Okay, another try, now with pictures :) :
So far we are doing this:
https://metameute.de/~tux/batman-adv/multicast-listener-fetching-no-bridge.p...
So we are able to fetch local listeners (with "local" I mean listeners which are present on the same kernel) from bat0 via batadv_mcast_mla_softif_get(). And are announcing them in the mesh cloud so that multicast senders know which nodes they need to send their data to.
This box with the local listener could be an embedded router running batman-adv receiving music via multicast and playing it directly over its USB sound card.
---
With this patch batadv_mla_bridge_get() is being added:
https://metameute.de/~tux/batman-adv/multicast-listener-fetching-with-bridge...
Now we are able to detect bridged-in listeners (with "bridged-in" I mean listeners behind the bridge of a batman-adv node, some alien device). For instance this could be a non-Linux laptop wanting to receive the same or a different multicast music stream.
Also note, that in the bridge-case batadv_mcast_mla_softif_get() gets its local listener information from a different device now, marked in orange: Just like you wouldn't use IP addresses+routes on bat0 anymore but br0 instead, also the local multicast listeners will be registering to br0 instead of bat0 now. That's where the "bridge ? bridge : dev" code changes in this patch for batadv_mcast_mla_softif_get() come from.
---
tl;dr: batadv_mla_softif_get() is for multicast listeners *on* a batman-adv node, batadv_mla_bridge_get() for multicast listeners *behind* the bridge of a batman-adv node.
If the pictures are somehow helpful and if others feel this is worth a new wiki page in the batadv-multicast-docs, I can create one. (Also, I hope especially the second one isn't too overloaded, if someone has ideas how to simplify it, I'd be glad to hear about it.)
Cheers, Linus