All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [PATCH v2 2/3] batman-adv: mcast: collect softif listeners from IP lists instead
Date: Sat, 25 May 2019 13:40:11 +0200	[thread overview]
Message-ID: <1915041.aIAeFaJ9db@sven-edge> (raw)
In-Reply-To: <20190507034824.3362-3-tux@c0d3.blue>


[-- Attachment #1.1: Type: text/plain, Size: 510 bytes --]

On Tuesday, 7 May 2019 05:48:23 CEST T_X wrote:
[..]
> Instead of collecting multicast MAC addresses from the netdev hw mc
> list collect a node's multicast listeners from the IP lists and convert
> those to MAC addresses.
> 
> This allows to exclude addresses of specific scope later. On a
> multicast MAC address the IP destination scope is not visible anymore.
> 
> Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>

There are various build problems. See attachment.

Kind regards,
	Sven

[-- Attachment #1.2: kbuild test robot <lkp@intel.com>: [batman:batadv/net-next 7/7] net/batman-adv/multicast.c:446:55: error: 'union <anonymous>' has no member named 'ip6'; did you mean 'ip4'? --]
[-- Type: message/rfc822, Size: 63768 bytes --]

[-- Attachment #1.2.1.1: Type: text/plain, Size: 8217 bytes --]

tree:   git://git.open-mesh.org/linux-merge batadv/net-next
head:   5e8230d96b966a3691f83e2b053798487725353e
commit: 5e8230d96b966a3691f83e2b053798487725353e [7/7] batman-adv: mcast: avoid redundant multicast TT entries with bridges
config: x86_64-randconfig-x008-201920 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout 5e8230d96b966a3691f83e2b053798487725353e
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   net/batman-adv/multicast.c: In function 'batadv_mcast_mla_softif_get':
   net/batman-adv/multicast.c:362:42: error: passing argument 1 of 'batadv_mcast_mla_softif_get_ipv6' from incompatible pointer type [-Werror=incompatible-pointer-types]
     ret6 = batadv_mcast_mla_softif_get_ipv6(dev, mcast_list, flags);
                                             ^~~
   net/batman-adv/multicast.c:320:1: note: expected 'struct batadv_priv *' but argument is of type 'struct net_device *'
    batadv_mcast_mla_softif_get_ipv6(struct batadv_priv *bat_priv,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/batman-adv/multicast.c:362:47: error: passing argument 2 of 'batadv_mcast_mla_softif_get_ipv6' from incompatible pointer type [-Werror=incompatible-pointer-types]
     ret6 = batadv_mcast_mla_softif_get_ipv6(dev, mcast_list, flags);
                                                  ^~~~~~~~~~
   net/batman-adv/multicast.c:320:1: note: expected 'struct net_device *' but argument is of type 'struct hlist_head *'
    batadv_mcast_mla_softif_get_ipv6(struct batadv_priv *bat_priv,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/batman-adv/multicast.c:362:59: error: passing argument 3 of 'batadv_mcast_mla_softif_get_ipv6' from incompatible pointer type [-Werror=incompatible-pointer-types]
     ret6 = batadv_mcast_mla_softif_get_ipv6(dev, mcast_list, flags);
                                                              ^~~~~
   net/batman-adv/multicast.c:320:1: note: expected 'struct hlist_head *' but argument is of type 'struct batadv_mcast_mla_flags *'
    batadv_mcast_mla_softif_get_ipv6(struct batadv_priv *bat_priv,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/batman-adv/multicast.c: In function 'batadv_mcast_mla_bridge_get':
>> net/batman-adv/multicast.c:446:55: error: 'union <anonymous>' has no member named 'ip6'; did you mean 'ip4'?
           ipv6_addr_is_ll_all_nodes(&br_ip_entry->addr.u.ip6))
                                                          ^~~
                                                          ip4
   cc1: some warnings being treated as errors

vim +446 net/batman-adv/multicast.c

   327	
   328	/**
   329	 * batadv_mcast_mla_softif_get() - get softif multicast listeners
   330	 * @dev: the device to collect multicast addresses from
   331	 * @mcast_list: a list to put found addresses into
   332	 * @flags: flags indicating the new multicast state
   333	 *
   334	 * Collects multicast addresses of multicast listeners residing
   335	 * on this kernel on the given soft interface, dev, in
   336	 * the given mcast_list. In general, multicast listeners provided by
   337	 * your multicast receiving applications run directly on this node.
   338	 *
   339	 * If there is a bridge interface on top of dev, collects from that one
   340	 * instead. Just like with IP addresses and routes, multicast listeners
   341	 * will(/should) register to the bridge interface instead of an
   342	 * enslaved bat0.
   343	 *
   344	 * Return: -ENOMEM on memory allocation error or the number of
   345	 * items added to the mcast_list otherwise.
   346	 */
   347	static int
   348	batadv_mcast_mla_softif_get(struct net_device *dev,
   349				    struct hlist_head *mcast_list,
   350				    struct batadv_mcast_mla_flags *flags)
   351	{
   352		struct net_device *bridge = batadv_mcast_get_bridge(dev);
   353		int ret4, ret6 = 0;
   354	
   355		if (bridge)
   356			dev = bridge;
   357	
   358		ret4 = batadv_mcast_mla_softif_get_ipv4(dev, mcast_list, flags);
   359		if (ret4 < 0)
   360			goto out;
   361	
 > 362		ret6 = batadv_mcast_mla_softif_get_ipv6(dev, mcast_list, flags);
   363		if (ret6 < 0) {
   364			ret4 = 0;
   365			goto out;
   366		}
   367	
   368	out:
   369		if (bridge)
   370			dev_put(bridge);
   371	
   372		return ret4 + ret6;
   373	}
   374	
   375	/**
   376	 * batadv_mcast_mla_br_addr_cpy() - copy a bridge multicast address
   377	 * @dst: destination to write to - a multicast MAC address
   378	 * @src: source to read from - a multicast IP address
   379	 *
   380	 * Converts a given multicast IPv4/IPv6 address from a bridge
   381	 * to its matching multicast MAC address and copies it into the given
   382	 * destination buffer.
   383	 *
   384	 * Caller needs to make sure the destination buffer can hold
   385	 * at least ETH_ALEN bytes.
   386	 */
   387	static void batadv_mcast_mla_br_addr_cpy(char *dst, const struct br_ip *src)
   388	{
   389		if (src->proto == htons(ETH_P_IP))
   390			ip_eth_mc_map(src->u.ip4, dst);
   391	#if IS_ENABLED(CONFIG_IPV6)
   392		else if (src->proto == htons(ETH_P_IPV6))
   393			ipv6_eth_mc_map(&src->u.ip6, dst);
   394	#endif
   395		else
   396			eth_zero_addr(dst);
   397	}
   398	
   399	/**
   400	 * batadv_mcast_mla_bridge_get() - get bridged-in multicast listeners
   401	 * @dev: a bridge slave whose bridge to collect multicast addresses from
   402	 * @mcast_list: a list to put found addresses into
   403	 * @flags: flags indicating the new multicast state
   404	 *
   405	 * Collects multicast addresses of multicast listeners residing
   406	 * on foreign, non-mesh devices which we gave access to our mesh via
   407	 * a bridge on top of the given soft interface, dev, in the given
   408	 * mcast_list.
   409	 *
   410	 * Return: -ENOMEM on memory allocation error or the number of
   411	 * items added to the mcast_list otherwise.
   412	 */
   413	static int batadv_mcast_mla_bridge_get(struct net_device *dev,
   414					       struct hlist_head *mcast_list,
   415					       struct batadv_mcast_mla_flags *flags)
   416	{
   417		struct list_head bridge_mcast_list = LIST_HEAD_INIT(bridge_mcast_list);
   418		struct br_ip_list *br_ip_entry, *tmp;
   419		u8 tvlv_flags = flags->tvlv_flags;
   420		struct batadv_hw_addr *new;
   421		u8 mcast_addr[ETH_ALEN];
   422		int ret;
   423	
   424		/* we don't need to detect these devices/listeners, the IGMP/MLD
   425		 * snooping code of the Linux bridge already does that for us
   426		 */
   427		ret = br_multicast_list_adjacent(dev, &bridge_mcast_list);
   428		if (ret < 0)
   429			goto out;
   430	
   431		list_for_each_entry(br_ip_entry, &bridge_mcast_list, list) {
   432			if (br_ip_entry->addr.proto == htons(ETH_P_IP)) {
   433				if (tvlv_flags & BATADV_MCAST_WANT_ALL_IPV4)
   434					continue;
   435	
   436				if (tvlv_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES &&
   437				    ipv4_is_local_multicast(br_ip_entry->addr.u.ip4))
   438					continue;
   439			}
   440	
   441			if (br_ip_entry->addr.proto == htons(ETH_P_IPV6)) {
   442				if (tvlv_flags & BATADV_MCAST_WANT_ALL_IPV6)
   443					continue;
   444	
   445				if (tvlv_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES &&
 > 446				    ipv6_addr_is_ll_all_nodes(&br_ip_entry->addr.u.ip6))
   447					continue;
   448			}
   449	
   450			batadv_mcast_mla_br_addr_cpy(mcast_addr, &br_ip_entry->addr);
   451			if (batadv_mcast_mla_is_duplicate(mcast_addr, mcast_list))
   452				continue;
   453	
   454			new = kmalloc(sizeof(*new), GFP_ATOMIC);
   455			if (!new) {
   456				ret = -ENOMEM;
   457				break;
   458			}
   459	
   460			ether_addr_copy(new->addr, mcast_addr);
   461			hlist_add_head(&new->list, mcast_list);
   462		}
   463	
   464	out:
   465		list_for_each_entry_safe(br_ip_entry, tmp, &bridge_mcast_list, list) {
   466			list_del(&br_ip_entry->list);
   467			kfree(br_ip_entry);
   468		}
   469	
   470		return ret;
   471	}
   472	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #1.2.1.2: .config.gz --]
[-- Type: application/gzip, Size: 39600 bytes --]

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-05-25 11:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  3:48 [PATCH v2 0/3] batman-adv: routeable multicast preparations T_X
2019-05-07  3:48 ` [PATCH v2 1/3] batman-adv: mcast: shorten multicast tt/tvlv worker spinlock section T_X
2019-05-07  3:48 ` [PATCH v2 2/3] batman-adv: mcast: collect softif listeners from IP lists instead T_X
2019-05-25 11:40   ` Sven Eckelmann [this message]
2019-05-07  3:48 ` [PATCH v2 3/3] batman-adv: mcast: avoid redundant multicast TT entries with bridges T_X
  -- strict thread matches above, loose matches on Subject: below --
2019-05-07  4:08 [PATCH v3 0/3] batman-adv: routeable multicast preparations Linus Lüssing
2019-05-07  4:08 ` [PATCH v2 2/3] batman-adv: mcast: collect softif listeners from IP lists instead Linus Lüssing

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=1915041.aIAeFaJ9db@sven-edge \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.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 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.