Patch to add mesh_no_rebroadcast
Commit Message
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---
hard-interface.c | 2 ++
send.c | 4 ++++
sysfs-class-net-batman-adv | 10 ++++++++
sysfs.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++
types.h | 1 +
5 files changed, 76 insertions(+)
Comments
On Saturday 16 May 2015 22:07:36 Ruben Wisniewski wrote:
> Signed-off-by: Linus Lüssing <linus.luessing@web.de>
> ---
Why are you sending a patch from Linus? And this patch doesn't apply on
current master or next.
Kind regards,
Sven
On Sunday 17 May 2015 00:00:27 Sven Eckelmann wrote:
> On Saturday 16 May 2015 22:07:36 Ruben Wisniewski wrote:
> > Signed-off-by: Linus Lüssing <linus.luessing@web.de>
> > ---
>
> Why are you sending a patch from Linus? And this patch doesn't apply on
> current master or next.
Just to make it more clear: I think it is not a problem to pick up some old
patch from someone else when the original author has no problem with it. But
taking a patch from someone else and then without any additional information
claiming to be the author is a rather bad move.
It is even worse that the informative commit subject + message was dropped.
There is also no information what you've changed before your signed-off-by
(which is also missing).
Btw. here is the original patch and the discussion
http://thread.gmane.org/gmane.org.freifunk.batman/10503
Kind regards,
Sven
Am Sun, 17 May 2015 09:11:18 +0200
schrieb Sven Eckelmann <sven@narfation.org>:
> > Why are you sending a patch from Linus? And this patch doesn't
> > apply on current master or next.
>
> Just to make it more clear: I think it is not a problem to pick up
> some old patch from someone else when the original author has no
> problem with it. But taking a patch from someone else and then
> without any additional information claiming to be the author is a
> rather bad move.
It is a old patch which is fixed to apply to the latest stable version.
I talk to Simon yesterday, that it would be nice if the freifunker does
not need to ship this patch in any installation, since we start to setup
custom repos with this patch included and so on...
Else all freifunk-firmwares include this patch, this should be stable.
> It is even worse that the informative commit subject + message was
> dropped. There is also no information what you've changed before your
> signed-off-by (which is also missing).
Yes, I removed it, since the last patches I found on this mailinglist
does not have this information-part. So I thought this is the given
form for this mailinglist. (There is no information about that on the
mailinglist site).
> Btw. here is the original patch and the discussion
> http://thread.gmane.org/gmane.org.freifunk.batman/10503
I know this patch and discussion, I've read it yesterday with Simon and
he asked me to send our version of the patch to the mailinglist.
Best regards
Ruben
Please don't drop the mailing list when replying (unless it is actually
private conversation).
On Sunday 17 May 2015 11:12:08 Ruben Wisniewski wrote:
> schrieb Sven Eckelmann <sven@narfation.org>:
> > Why are you sending a patch from Linus?
>
> Because Simon said to me to do so yesterday. :)
See my other mail with a more detailed explanation.
> > And this patch doesn't apply on current master or next.
>
> We have this patch in our setup and it's applying to 2015.0.
But v2015.0 is not master or next. And since it is a new feature, I would
guess it should be applied on master.
Kind regards,
Sven
On Sunday 17 May 2015 11:16:59 Ruben Wisniewski wrote:
> Am Sun, 17 May 2015 09:11:18 +0200
>
> schrieb Sven Eckelmann <sven@narfation.org>:
> > > Why are you sending a patch from Linus? And this patch doesn't
> > > apply on current master or next.
> >
> > Just to make it more clear: I think it is not a problem to pick up
> > some old patch from someone else when the original author has no
> > problem with it. But taking a patch from someone else and then
> > without any additional information claiming to be the author is a
> > rather bad move.
>
> It is a old patch which is fixed to apply to the latest stable version.
>
> I talk to Simon yesterday, that it would be nice if the freifunker does
> not need to ship this patch in any installation, since we start to setup
> custom repos with this patch included and so on...
>
> Else all freifunk-firmwares include this patch, this should be stable.
Still not a reason to drop the original author information from the patch. See
https://www.kernel.org/doc/Documentation/SubmittingPatches under "11) Sign
your work" for information how your modifications to the original patch could
be documented inside the Signed-off-by part without removing the original
authorship.
See under https://www.kernel.org/doc/Documentation/SubmittingPatches "14) The
canonical patch format" to find out how the authorship of a patch is
"calculated" (right under the "Subject" part of this section).
> > It is even worse that the informative commit subject + message was
> > dropped. There is also no information what you've changed before your
> > signed-off-by (which is also missing).
>
> Yes, I removed it, since the last patches I found on this mailinglist
> does not have this information-part.
Could not find a different version of this patch on this mailing list. So
there is no reason to drop it yourself without documenting it somewhere.
And the last patches I see on the mailing list (besides the ones from you)
are:
* https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-May/013106.html
* https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-May/013108.html
* https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-May/013109.html
* https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/013068.html
* https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/013066.html
* https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/013065.html
* https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/013064.html
* https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/013061.html
The only patches which don't have a long description are patches to the compat
code, trivial checkpatch changes and the copyright stuff (sry, I refuse to
explain why the year has changed). The compat patch without description
doesn't will not be submitted to the Linux networking subsystem maintainer.
And since it doesn't fix anything, the text to describe the change would be
rather uninteresting.
I think original commit message from Linus for this patch has vital
information to understand what the new option does, why it is needed and in
which situation it can be used/not be used.
> So I thought this is the given
> form for this mailinglist. (There is no information about that on the
> mailinglist site).
This is not about the mailing list directly. The contributing information can
be found under:
* https://www.open-mesh.org/projects/open-mesh/wiki/Contribute
* https://www.kernel.org/doc/Documentation/SubmittingPatches
* https://www.kernel.org/doc/Documentation/CodingStyle
Kind regards,
Sven
Hi Ruben,
thanks for re-sending the patch - as Sven pointed out we need to have it
formatted properly before we can accept it. He mentioned various links which
we have on the wiki, if you have troubles to apply we can also help you on
IRC.
@All: I've been talking to Ruben personally at Wireless Community Weekend. He
explained that they drag this patch around for their gluon community firmware
and would like to get it merged - I found the original discussion, but he had
some good arguments to merge it anyway. Therefore I've asked Ruben to rebase
and send it again to re-start the discussion. :)
Thanks!
Simon
On Saturday 16 May 2015 22:07:36 Ruben Wisniewski wrote:
> Signed-off-by: Linus Lüssing <linus.luessing@web.de>
> ---
> hard-interface.c | 2 ++
> send.c | 4 ++++
> sysfs-class-net-batman-adv | 10 ++++++++
> sysfs.c | 59
> ++++++++++++++++++++++++++++++++++++++++++++++ types.h |
> 1 +
> 5 files changed, 76 insertions(+)
>
> diff --git a/hard-interface.c b/hard-interface.c
> index fbda6b5..3997f9c 100644
> --- a/hard-interface.c
> +++ b/hard-interface.c
> @@ -591,6 +591,8 @@ batadv_hardif_add_interface(struct net_device *net_dev)
> /* extra reference for return */
> atomic_set(&hard_iface->refcount, 2);
>
> + atomic_set(&hard_iface->no_rebroadcast, 0);
> +
> batadv_check_known_mac_addr(hard_iface->net_dev);
> list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
>
> diff --git a/send.c b/send.c
> index d27161e..4383a66 100644
> --- a/send.c
> +++ b/send.c
> @@ -513,6 +513,10 @@ static void batadv_send_outstanding_bcast_packet(struct
> work_struct *work) if (forw_packet->num_packets >= hard_iface->num_bcasts)
> continue;
>
> + if (atomic_read(&hard_iface->no_rebroadcast) &&
> + forw_packet->skb->dev == hard_iface->net_dev)
> + continue;
> +
> /* send a copy of the saved skb */
> skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC);
> if (skb1)
> diff --git a/sysfs-class-net-batman-adv b/sysfs-class-net-batman-adv
> index 7f34a95..cf7fe00 100644
> --- a/sysfs-class-net-batman-adv
> +++ b/sysfs-class-net-batman-adv
> @@ -13,3 +13,13 @@ Description:
> displays the batman mesh interface this <iface>
> currently is associated with.
>
> +What: /sys/class/net/<iface>/batman-adv/no_rebroadcast
> +Date: Sep 2013
> +Contact: Linus Lüssing <linus.luessing@web.de>
> +Description:
> + With this option set incoming multicast payload frames on
> + <iface> are not being rebroadcasted on <iface> again. This
> + option should be set on links which are known to be
> transitive + and symmetric only, for instance point-to-point
> wifi longshots + or wired links. Using this option wrongly
> is going to + break your mesh network, use at your own risk!
> diff --git a/sysfs.c b/sysfs.c
> index fc47baa..adaeca4 100644
> --- a/sysfs.c
> +++ b/sysfs.c
> @@ -110,6 +110,17 @@ struct batadv_attribute batadv_attr_vlan_##_name = { \
> .store = _store, \
> }
>
> +/* Use this, if you have customized show and store functions
> + * for hard interface attrs
> + */
> +#define BATADV_ATTR_HIF(_name, _mode, _show, _store) \
> +struct batadv_attribute batadv_attr_hif_##_name = { \
> + .attr = {.name = __stringify(_name), \
> + .mode = _mode }, \
> + .show = _show, \
> + .store = _store, \
> +};
> +
> /* Use this, if you have customized show and store functions */
> #define BATADV_ATTR(_name, _mode, _show, _store) \
> struct batadv_attribute batadv_attr_##_name = { \
> @@ -221,6 +232,52 @@ ssize_t batadv_show_vlan_##_name(struct kobject
> *kobj, \ static BATADV_ATTR_VLAN(_name, _mode,
> batadv_show_vlan_##_name, \ batadv_store_vlan_##_name)
>
> +#define BATADV_ATTR_HIF_STORE_BOOL(_name, _post_func) \
> +ssize_t batadv_store_hif_##_name(struct kobject *kobj, \
> + struct attribute *attr, char *buff, \
> + size_t count) \
> +{ \
> + struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
> + struct batadv_hard_iface *hard_iface; \
> + size_t res; \
> + \
> + hard_iface = batadv_hardif_get_by_netdev(net_dev); \
> + if (!hard_iface) \
> + return 0; \
> + \
> + res = __batadv_store_bool_attr(buff, count, _post_func, \
> + attr, &hard_iface->_name, \
> + hard_iface->soft_iface); \
> + batadv_hardif_free_ref(hard_iface); \
> + return res; \
> +}
> +
> +#define BATADV_ATTR_HIF_SHOW_BOOL(_name) \
> +ssize_t batadv_show_hif_##_name(struct kobject *kobj, \
> + struct attribute *attr, char *buff) \
> +{ \
> + struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
> + struct batadv_hard_iface *hard_iface; \
> + size_t res; \
> + \
> + hard_iface = batadv_hardif_get_by_netdev(net_dev); \
> + if (!hard_iface) \
> + return 0; \
> + \
> + res = sprintf(buff, "%s\n", \
> + atomic_read(&hard_iface->_name) == 0 ? \
> + "disabled" : "enabled"); \
> + batadv_hardif_free_ref(hard_iface); \
> + return res; \
> +}
> +
> +/* Use this, if you are going to turn a [name] in the vlan struct on or off
> */ +#define BATADV_ATTR_HIF_BOOL(_name, _mode, _post_func) \
> + static BATADV_ATTR_HIF_STORE_BOOL(_name, _post_func) \
> + static BATADV_ATTR_HIF_SHOW_BOOL(_name) \
> + static BATADV_ATTR_HIF(_name, _mode, batadv_show_hif_##_name, \
> + batadv_store_hif_##_name)
> +
> static int batadv_store_bool_attr(char *buff, size_t count,
> struct net_device *net_dev,
> const char *attr_name, atomic_t *attr)
> @@ -844,10 +901,12 @@ static ssize_t batadv_show_iface_status(struct kobject
> *kobj, static BATADV_ATTR(mesh_iface, S_IRUGO | S_IWUSR,
> batadv_show_mesh_iface, batadv_store_mesh_iface);
> static BATADV_ATTR(iface_status, S_IRUGO, batadv_show_iface_status, NULL);
> +BATADV_ATTR_HIF_BOOL(no_rebroadcast, S_IRUGO | S_IWUSR, NULL);
>
> static struct batadv_attribute *batadv_batman_attrs[] = {
> &batadv_attr_mesh_iface,
> &batadv_attr_iface_status,
> + &batadv_attr_hif_no_rebroadcast,
> NULL,
> };
>
> diff --git a/types.h b/types.h
> index 8854c05..39619fb 100644
> --- a/types.h
> +++ b/types.h
> @@ -101,6 +101,7 @@ struct batadv_hard_iface {
> struct batadv_hard_iface_bat_iv bat_iv;
> struct work_struct cleanup_work;
> struct dentry *debug_dir;
> + atomic_t no_rebroadcast;
> };
>
> /**
On Monday, May 18, 2015 10:33:10 Simon Wunderlich wrote:
> @All: I've been talking to Ruben personally at Wireless Community Weekend.
> He explained that they drag this patch around for their gluon community
> firmware and would like to get it merged - I found the original discussion,
> but he had some good arguments to merge it anyway. Therefore I've asked
> Ruben to rebase and send it again to re-start the discussion.
It might be a good idea to send an explanation with the patch to get the
discussion started. What are the arguments in favor of this patch ? A little
more than 'Patch to add mesh_no_rebroadcast' would be nice.
Cheers,
Marek
Hi,
>
> It might be a good idea to send an explanation with the patch to get
> the
> discussion started. What are the arguments in favor of this patch ? A
> little
> more than 'Patch to add mesh_no_rebroadcast' would be nice.
>
Is there any advance towards including this patch?
Regards
Björn
Hi Bjoern,
there wasn't any activity on this patch (at least from our side), and there
wasn't any reaction on Mareks suggestion to add more explanation to the patch.
If you want to get it adopted, please resend it (rebased on current master)
with a proper commit message explaining what it does and why its useful - like
we have for any other patch.
Thanks,
Simon
On Thursday 06 August 2015 23:23:28 Bjoern Franke wrote:
> Hi,
>
> > It might be a good idea to send an explanation with the patch to get
> > the
> > discussion started. What are the arguments in favor of this patch ? A
> > little
> > more than 'Patch to add mesh_no_rebroadcast' would be nice.
>
> Is there any advance towards including this patch?
>
> Regards
> Björn
Any progress here?
Would be nice if you would just apply it, since the whole
freifunk-community is patching this patch on all versions of batman-adv
at the moment. So it's well tested.
Best regards
Ruben
Am Fri, 07 Aug 2015 02:25:22 +0200
schrieb Simon Wunderlich <sw@simonwunderlich.de>:
> Hi Bjoern,
>
> there wasn't any activity on this patch (at least from our side), and
> there wasn't any reaction on Mareks suggestion to add more
> explanation to the patch.
>
> If you want to get it adopted, please resend it (rebased on current
> master) with a proper commit message explaining what it does and why
> its useful - like we have for any other patch.
>
> Thanks,
> Simon
>
> On Thursday 06 August 2015 23:23:28 Bjoern Franke wrote:
> > Hi,
> >
> > > It might be a good idea to send an explanation with the patch to
> > > get the
> > > discussion started. What are the arguments in favor of this
> > > patch ? A little
> > > more than 'Patch to add mesh_no_rebroadcast' would be nice.
> >
> > Is there any advance towards including this patch?
> >
> > Regards
> > Björn
---
Mit freundlichen Grüßen
Ruben Wisniewski
Vorstandsmitglied im
Verbund freier Netzwerke NRW e.V.
Verein zur Förderung von freien Netzstrukturen in NRW
VR 17981 Amtsgericht Köln
Internet-Service-Provider-Nr 14/223 Bundesnetzagentur
Gemeinnütziger Verein im Bereich Volks- und Berufsbildung geführt beim
Finanzamt Leverkusen
Telefon: +4921967382850
E-Mail: vorstand@vfn-nrw.de
Web: https://vfn-nrw.de
Anschrift:
Postfach 50 13 63,
D-42906 Wermelskirchen
On Mittwoch, 27. Juli 2016 04:17:34 CEST Ruben Kelevra wrote:
> Any progress here?
Still waiting for the TRANSITIVE flag version from Linus.
Kind regards,
Sven
@@ -591,6 +591,8 @@ batadv_hardif_add_interface(struct net_device *net_dev)
/* extra reference for return */
atomic_set(&hard_iface->refcount, 2);
+ atomic_set(&hard_iface->no_rebroadcast, 0);
+
batadv_check_known_mac_addr(hard_iface->net_dev);
list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
@@ -513,6 +513,10 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work)
if (forw_packet->num_packets >= hard_iface->num_bcasts)
continue;
+ if (atomic_read(&hard_iface->no_rebroadcast) &&
+ forw_packet->skb->dev == hard_iface->net_dev)
+ continue;
+
/* send a copy of the saved skb */
skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC);
if (skb1)
@@ -13,3 +13,13 @@ Description:
displays the batman mesh interface this <iface>
currently is associated with.
+What: /sys/class/net/<iface>/batman-adv/no_rebroadcast
+Date: Sep 2013
+Contact: Linus Lüssing <linus.luessing@web.de>
+Description:
+ With this option set incoming multicast payload frames on
+ <iface> are not being rebroadcasted on <iface> again. This
+ option should be set on links which are known to be transitive
+ and symmetric only, for instance point-to-point wifi longshots
+ or wired links. Using this option wrongly is going to
+ break your mesh network, use at your own risk!
@@ -110,6 +110,17 @@ struct batadv_attribute batadv_attr_vlan_##_name = { \
.store = _store, \
}
+/* Use this, if you have customized show and store functions
+ * for hard interface attrs
+ */
+#define BATADV_ATTR_HIF(_name, _mode, _show, _store) \
+struct batadv_attribute batadv_attr_hif_##_name = { \
+ .attr = {.name = __stringify(_name), \
+ .mode = _mode }, \
+ .show = _show, \
+ .store = _store, \
+};
+
/* Use this, if you have customized show and store functions */
#define BATADV_ATTR(_name, _mode, _show, _store) \
struct batadv_attribute batadv_attr_##_name = { \
@@ -221,6 +232,52 @@ ssize_t batadv_show_vlan_##_name(struct kobject *kobj, \
static BATADV_ATTR_VLAN(_name, _mode, batadv_show_vlan_##_name, \
batadv_store_vlan_##_name)
+#define BATADV_ATTR_HIF_STORE_BOOL(_name, _post_func) \
+ssize_t batadv_store_hif_##_name(struct kobject *kobj, \
+ struct attribute *attr, char *buff, \
+ size_t count) \
+{ \
+ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
+ struct batadv_hard_iface *hard_iface; \
+ size_t res; \
+ \
+ hard_iface = batadv_hardif_get_by_netdev(net_dev); \
+ if (!hard_iface) \
+ return 0; \
+ \
+ res = __batadv_store_bool_attr(buff, count, _post_func, \
+ attr, &hard_iface->_name, \
+ hard_iface->soft_iface); \
+ batadv_hardif_free_ref(hard_iface); \
+ return res; \
+}
+
+#define BATADV_ATTR_HIF_SHOW_BOOL(_name) \
+ssize_t batadv_show_hif_##_name(struct kobject *kobj, \
+ struct attribute *attr, char *buff) \
+{ \
+ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
+ struct batadv_hard_iface *hard_iface; \
+ size_t res; \
+ \
+ hard_iface = batadv_hardif_get_by_netdev(net_dev); \
+ if (!hard_iface) \
+ return 0; \
+ \
+ res = sprintf(buff, "%s\n", \
+ atomic_read(&hard_iface->_name) == 0 ? \
+ "disabled" : "enabled"); \
+ batadv_hardif_free_ref(hard_iface); \
+ return res; \
+}
+
+/* Use this, if you are going to turn a [name] in the vlan struct on or off */
+#define BATADV_ATTR_HIF_BOOL(_name, _mode, _post_func) \
+ static BATADV_ATTR_HIF_STORE_BOOL(_name, _post_func) \
+ static BATADV_ATTR_HIF_SHOW_BOOL(_name) \
+ static BATADV_ATTR_HIF(_name, _mode, batadv_show_hif_##_name, \
+ batadv_store_hif_##_name)
+
static int batadv_store_bool_attr(char *buff, size_t count,
struct net_device *net_dev,
const char *attr_name, atomic_t *attr)
@@ -844,10 +901,12 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj,
static BATADV_ATTR(mesh_iface, S_IRUGO | S_IWUSR, batadv_show_mesh_iface,
batadv_store_mesh_iface);
static BATADV_ATTR(iface_status, S_IRUGO, batadv_show_iface_status, NULL);
+BATADV_ATTR_HIF_BOOL(no_rebroadcast, S_IRUGO | S_IWUSR, NULL);
static struct batadv_attribute *batadv_batman_attrs[] = {
&batadv_attr_mesh_iface,
&batadv_attr_iface_status,
+ &batadv_attr_hif_no_rebroadcast,
NULL,
};
@@ -101,6 +101,7 @@ struct batadv_hard_iface {
struct batadv_hard_iface_bat_iv bat_iv;
struct work_struct cleanup_work;
struct dentry *debug_dir;
+ atomic_t no_rebroadcast;
};
/**