From: Marek Lindner <lindner_marek@yahoo.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCHv7 2/4] batman-adv: Announce new capability via multicast TVLV
Date: Sat, 6 Jul 2013 18:57:44 +0800 [thread overview]
Message-ID: <201307061857.44563.lindner_marek@yahoo.de> (raw)
In-Reply-To: <1372889002-6767-3-git-send-email-linus.luessing@web.de>
On Thursday, July 04, 2013 06:03:20 Linus Lüssing wrote:
> diff --git a/multicast.c b/multicast.c
> index 7ea19ab..4af4bc9 100644
> --- a/net/batman-adv/multicast.c
> +++ b/net/batman-adv/multicast.c
> @@ -169,13 +169,30 @@ void batadv_mcast_mla_tt_update(struct batadv_priv
> *bat_priv) struct net_device *soft_iface = bat_priv->soft_iface;
> struct hlist_head mcast_list = HLIST_HEAD_INIT;
> int ret;
> + static bool enabled;
> + uint8_t mcast_flags;
>
> /* Avoid attaching MLAs, if multicast optimization is disabled
> * or there is a bridge on top of our soft interface (TODO)
> */
> if (!atomic_read(&bat_priv->multicast_mode) ||
> - bat_priv->soft_iface->priv_flags & IFF_BRIDGE_PORT)
> + bat_priv->soft_iface->priv_flags & IFF_BRIDGE_PORT) {
> + if (enabled) {
> + batadv_tvlv_container_unregister(bat_priv,
> + BATADV_TVLV_MCAST,
> 1); + enabled = false;
> + }
> +
> goto update;
> + }
> +
> + if (!enabled) {
> + mcast_flags = BATADV_MCAST_LISTENER_ANNOUNCEMENT;
> + batadv_tvlv_container_register(bat_priv, BATADV_TVLV_MCAST,
> 1, + &mcast_flags,
> + sizeof(mcast_flags));
> + enabled = true;
> + }
>
> ret = batadv_mcast_mla_softif_get(soft_iface, &mcast_list);
> if (ret < 0)
Is there no better way than using a static variable ? Apart from bad
readibility this totally breaks when using several batX interfaces with
different settings.
> +/* multicast capabilities */
> +enum batadv_mcast_flags {
> + BATADV_MCAST_LISTENER_ANNOUNCEMENT = BIT(0),
> +};
Didn't we discuss that using feature names is better ? We talked about things
like UNICAST, TRACKER, etc ?
Cheers,
Marek
next prev parent reply other threads:[~2013-07-06 10:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-03 22:03 [B.A.T.M.A.N.] Basic Multicast Optimizations Linus Lüssing
2013-07-03 22:03 ` [B.A.T.M.A.N.] [PATCHv7 1/4] batman-adv: Multicast Listener Announcements via Translation Table Linus Lüssing
2013-07-03 22:03 ` [B.A.T.M.A.N.] [PATCHv7 2/4] batman-adv: Announce new capability via multicast TVLV Linus Lüssing
2013-07-06 10:57 ` Marek Lindner [this message]
2013-07-06 12:38 ` Linus Lüssing
2013-07-03 22:03 ` [B.A.T.M.A.N.] [PATCHv7 3/4] batman-adv: Modified forwarding behaviour for multicast packets Linus Lüssing
2013-07-03 22:03 ` [B.A.T.M.A.N.] [PATCHv7 4/4] batman-adv: Add IPv4 link-local/IPv6-ll-all-nodes multicast support Linus Lüssing
2013-07-12 9:12 ` Simon Wunderlich
2013-07-14 16:25 ` Linus Lüssing
2013-07-04 5:06 ` [B.A.T.M.A.N.] Basic Multicast Optimizations 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=201307061857.44563.lindner_marek@yahoo.de \
--to=lindner_marek@yahoo.de \
--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.