From: Antonio Quartulli <ordex@autistici.org>
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.] [PATCHv3] batman-adv: send each broadcast only once on non-wireless interfaces
Date: Sat, 9 Mar 2013 21:17:21 +0100 [thread overview]
Message-ID: <20130309201721.GQ1400@ritirata.org> (raw)
In-Reply-To: <f3fbb764235104e6dbc9a8e58ba66283d15e9d9f.1362825572.git.mschiffer@universe-factory.net>
[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]
Hi Matthias,
On Sat, Mar 09, 2013 at 11:40:26AM +0100, Matthias Schiffer wrote:
> @@ -515,6 +515,17 @@ batadv_hardif_add_interface(struct net_device *net_dev)
> INIT_WORK(&hard_iface->cleanup_work,
> batadv_hardif_remove_interface_finish);
>
> + hard_iface->num_bcasts = BATADV_NUM_BCASTS_DEFAULT;
> +
> +#if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211)
> + if (net_dev->ieee80211_ptr)
> + hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS;
> +#if IS_ENABLED(CONFIG_WIRELESS_EXT)
> + else if (net_dev->wireless_handlers)
> + hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS;
> +#endif
> +#endif
> +
> /* extra reference for return */
> atomic_set(&hard_iface->refcount, 2);
What about re-using batadv_is_wifi_iface() instead of adding the same code here?
:)
batadv_is_wifi_iface() takes an ifindex as parameter and then gets the
net_device by means of dev_get_by_index. You may want to split it up so that you
can avoid the research since you already have the related net_device object.
Cheers,
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-03-09 20:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-09 10:33 [B.A.T.M.A.N.] [PATCHv2] batman-adv: send each broadcast only once on non-wireless interfaces Matthias Schiffer
2013-03-09 10:40 ` [B.A.T.M.A.N.] [PATCHv3] " Matthias Schiffer
2013-03-09 20:17 ` Antonio Quartulli [this message]
2013-03-09 21:18 ` [B.A.T.M.A.N.] [PATCHv4 1/2] batman-adv: split batadv_is_wifi_iface() into two functions Matthias Schiffer
2013-03-09 21:18 ` [B.A.T.M.A.N.] [PATCHv4 2/2] batman-adv: send each broadcast only once on non-wireless interfaces Matthias Schiffer
2013-03-09 22:14 ` [B.A.T.M.A.N.] [PATCHv5 1/2] batman-adv: split batadv_is_wifi_iface() into two functions Matthias Schiffer
2013-03-09 22:14 ` [B.A.T.M.A.N.] [PATCHv5 2/2] batman-adv: send each broadcast only once on non-wireless interfaces Matthias Schiffer
2013-03-16 10:31 ` Marek Lindner
2013-03-16 10:21 ` [B.A.T.M.A.N.] [PATCHv5 1/2] batman-adv: split batadv_is_wifi_iface() into two functions Marek Lindner
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=20130309201721.GQ1400@ritirata.org \
--to=ordex@autistici.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox