[B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix broadcast+ogm queue purging race condition
by Linus Lüssing
So far on purging broadcast and ogm queues we temporarily give up the
spin lock of these queues to be able to cancel any scheduled forwarding
work. However this is unsafe and can lead to a general protection error
in batadv_purge_outstanding_packets().
With this patch we split the queue purging into two steps: First
removing forward packets from those queues and signaling the
cancelation. Secondly, we are actively canceling any scheduled
forwarding, wait for any running forwarding to finish and only free a
forw_packet afterwards.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
---
Fixes issue #168
send.c | 117 ++++++++++++++++++++++++++++++++++++++-------------------------
types.h | 1 +
2 files changed, 71 insertions(+), 47 deletions(-)
diff --git a/send.c b/send.c
index 0a0bb45..f93476b 100644
--- a/send.c
+++ b/send.c
@@ -245,6 +245,10 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work)
bat_priv = netdev_priv(soft_iface);
spin_lock_bh(&bat_priv->forw_bcast_list_lock);
+ if (hlist_unhashed(&forw_packet->list)) {
+ spin_unlock_bh(&bat_priv->forw_bcast_list_lock);
+ return;
+ }
hlist_del(&forw_packet->list);
spin_unlock_bh(&bat_priv->forw_bcast_list_lock);
@@ -293,6 +297,10 @@ void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work)
delayed_work);
bat_priv = netdev_priv(forw_packet->if_incoming->soft_iface);
spin_lock_bh(&bat_priv->forw_bat_list_lock);
+ if (hlist_unhashed(&forw_packet->list)) {
+ spin_unlock_bh(&bat_priv->forw_bat_list_lock);
+ return;
+ }
hlist_del(&forw_packet->list);
spin_unlock_bh(&bat_priv->forw_bat_list_lock);
@@ -316,13 +324,68 @@ out:
batadv_forw_packet_free(forw_packet);
}
+/**
+ * batadv_cancel_packets - Cancels a list of forward packets
+ * @forw_list: The to be canceled forward packets
+ * @canceled_list: The backup list.
+ *
+ * This canceles any scheduled forwarding packet tasks in the provided
+ * forw_list. The packets are being moved from the forw_list to the
+ * canceled_list afterwards to unhash the forward packet list pointer,
+ * allowing any already running task to notice the cancelation.
+ */
+static void batadv_cancel_packets(struct hlist_head *forw_list,
+ struct hlist_head *canceled_list,
+ const struct batadv_hard_iface *hard_iface)
+{
+ struct batadv_forw_packet *forw_packet;
+ struct hlist_node *tmp_node, *safe_tmp_node;
+
+ hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node,
+ forw_list, list) {
+ /* if purge_outstanding_packets() was called with an argument
+ * we delete only packets belonging to the given interface
+ */
+ if ((hard_iface) &&
+ (forw_packet->if_incoming != hard_iface))
+ continue;
+
+ hlist_del_init(&forw_packet->list);
+ hlist_add_head(&forw_packet->canceled_list, canceled_list);
+ }
+}
+
+/**
+ * batadv_canceled_packets_free - Frees canceled forward packets
+ * @head: A list of to be freed forw_packets
+ *
+ * This function canceles the scheduling of any packet in the provided list,
+ * waits for any possibly running packet forwarding thread to finish and
+ * finally, safely frees this forward packet.
+ *
+ * This function might sleep.
+ */
+static void batadv_canceled_packets_free(struct hlist_head *head)
+{
+ struct batadv_forw_packet *forw_packet;
+ struct hlist_node *tmp_node, *safe_tmp_node;
+
+ hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node, head,
+ canceled_list) {
+ cancel_delayed_work_sync(&forw_packet->delayed_work);
+
+ hlist_del(&forw_packet->canceled_list);
+ batadv_forw_packet_free(forw_packet);
+ }
+}
+
void
batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
const struct batadv_hard_iface *hard_iface)
{
- struct batadv_forw_packet *forw_packet;
- struct hlist_node *tmp_node, *safe_tmp_node;
- bool pending;
+ struct hlist_head head;
+
+ INIT_HLIST_HEAD(&head);
if (hard_iface)
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
@@ -334,53 +397,13 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
/* free bcast list */
spin_lock_bh(&bat_priv->forw_bcast_list_lock);
- hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node,
- &bat_priv->forw_bcast_list, list) {
- /* if purge_outstanding_packets() was called with an argument
- * we delete only packets belonging to the given interface
- */
- if ((hard_iface) &&
- (forw_packet->if_incoming != hard_iface))
- continue;
-
- spin_unlock_bh(&bat_priv->forw_bcast_list_lock);
-
- /* batadv_send_outstanding_bcast_packet() will lock the list to
- * delete the item from the list
- */
- pending = cancel_delayed_work_sync(&forw_packet->delayed_work);
- spin_lock_bh(&bat_priv->forw_bcast_list_lock);
-
- if (pending) {
- hlist_del(&forw_packet->list);
- batadv_forw_packet_free(forw_packet);
- }
- }
+ batadv_cancel_packets(&bat_priv->forw_bcast_list, &head, hard_iface);
spin_unlock_bh(&bat_priv->forw_bcast_list_lock);
/* free batman packet list */
spin_lock_bh(&bat_priv->forw_bat_list_lock);
- hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node,
- &bat_priv->forw_bat_list, list) {
- /* if purge_outstanding_packets() was called with an argument
- * we delete only packets belonging to the given interface
- */
- if ((hard_iface) &&
- (forw_packet->if_incoming != hard_iface))
- continue;
-
- spin_unlock_bh(&bat_priv->forw_bat_list_lock);
-
- /* send_outstanding_bat_packet() will lock the list to
- * delete the item from the list
- */
- pending = cancel_delayed_work_sync(&forw_packet->delayed_work);
- spin_lock_bh(&bat_priv->forw_bat_list_lock);
-
- if (pending) {
- hlist_del(&forw_packet->list);
- batadv_forw_packet_free(forw_packet);
- }
- }
+ batadv_cancel_packets(&bat_priv->forw_bat_list, &head, hard_iface);
spin_unlock_bh(&bat_priv->forw_bat_list_lock);
+
+ batadv_canceled_packets_free(&head);
}
diff --git a/types.h b/types.h
index aba8364..f62a35f 100644
--- a/types.h
+++ b/types.h
@@ -853,6 +853,7 @@ struct batadv_skb_cb {
*/
struct batadv_forw_packet {
struct hlist_node list;
+ struct hlist_node canceled_list;
unsigned long send_time;
uint8_t own;
struct sk_buff *skb;
--
1.7.10.4
6 years, 6 months
[B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix broadcast queue limit on a removed interface
by Linus Lüssing
When removing a single interface while a broadcast or ogm packet is
still pending then we will free the forward packet without releasing the
queue slots again.
This patch is supposed to fix this issue.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
---
send.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/send.c b/send.c
index ed7072a..2d539d6 100644
--- a/send.c
+++ b/send.c
@@ -356,6 +356,9 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
if (pending) {
hlist_del(&forw_packet->list);
+ if (!forw_packet->own)
+ atomic_inc(&bat_priv->bcast_queue_left);
+
batadv_forw_packet_free(forw_packet);
}
}
@@ -382,6 +385,9 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
if (pending) {
hlist_del(&forw_packet->list);
+ if (!forw_packet->own)
+ atomic_inc(&bat_priv->batman_queue_left);
+
batadv_forw_packet_free(forw_packet);
}
}
--
1.7.10.4
6 years, 9 months
[B.A.T.M.A.N.] Classes and purposed classes (problem to solve)
by cmsv
Scenario:
I have recently moved 13 nodes previously using wds to batman-adv.
One problem that i am encountering is the gateway selection and its
actually defectiveness.
This problem has be seen when the client nodes are set on class 20.
The node clients in fact select the gateways that advertise better link
quality usually above 200 but at the same time some clients end up
connecting to a gateway that is either too slow or unusable either due
to routing or other factors such as distance and even clear visibility.
In one case the node connects to something that defies logic.
I thought about ways to work around this and came up with an idea that
may help which means the creation of 2 new classes.
- Preferred gateway fall-back
- Preferred fixed gateway
For Preferred gateway fall-back:
consider the gateway's advertised quality towards the gateway and stick
with the selection until the gateway disappears returning to it soon as
it returns regardless of any other data.
- Preferred fixed gateway
Manual gateway selection by the node owner or admin. (wds type)
If these classes cannot be created; maybe a plugin of some sort could
be. could be called "gordon".
I understand that this idea may sound useless the same way blocking
originators may be for someone but in some scenarios just like blocking
originators it look to me very valid.
My current problem is that the link quality seems to go up and down like
a roller coaster in a specific order which causes the clients to switch
constantly sometimes many times per hour.
While this does not seem to be an issue for most client nodes; for 2 of
them it means no internet access at all.
The solution for now seems to be having these 2 nodes forced to use 1
specific gateway.
I am quite open to any ideas that may help resolve this issue that has
been casing some "uninformed people" to become headaches.
--
Redes wireless
http://wirelesspt.net
7 years, 2 months
[B.A.T.M.A.N.] TVLV infrastructure (v2)
by Marek Lindner
Hi,
at the battlemesh we had plenty of time to discuss and test the tvlv
patchset. Therefore, a number of changes/fixes found their way into
v2 touching the tvlv API, network coding, unicast sending and gateway
announcements.
This looks like the final version which is going to be merged unless
objections are raised soon-ish.
Cheers,
Marek
7 years, 7 months
[B.A.T.M.A.N.] [PATCH] batman-adv: compat-code for skb_abort_seq_read()
by Simon Wunderlich
Since skb_abort_seq_read() has been removed in the patch "net: Unmap
fragment page once iterator is done" in linux, but is still needed for
older kernel, add compat code to call it after the iteration is done.
Signed-off-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
---
compat.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/compat.h b/compat.h
index ddc1b29..e9b531f 100644
--- a/compat.h
+++ b/compat.h
@@ -326,6 +326,14 @@ static int __batadv_interface_set_mac_addr(x, y)
#define netdev_notifier_info_to_dev(ptr) ptr
+/* older kernels still need to call skb_abort_seq_read() */
+#define skb_seq_read(consumed, data, st) \
+ ({ \
+ int len = skb_seq_read(consumed, data, st); \
+ if (len == 0) \
+ skb_abort_seq_read(st); \
+ len; \
+ })
#endif /* < KERNEL_VERSION(3, 11, 0) */
#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
--
1.7.10.4
9 years, 5 months
[B.A.T.M.A.N.] Alfred Open Beta
by Simon Wunderlich
To those of you who actively follow the recent discussions it may come to no
big surprise that it was decided to remove the vis functionality from the
batman-adv kernel module in a not so distant future (with the next
compatibility bump). There always has been a debate whether or not such
functionality belongs into the kernel or not. The in-kernel solution bears the
disadvantage of being rather inflexible because every change has to go through
the official Linux channels. With the growing interest in flooding the network
with arbitrary data in addition to the visualization data realizing a solution
in user-space became the obvious choice.
A new, more general user-space daemon which takes over the old vis
functionality and much more, called A.L.F.R.E.D. (Almighty Lightweight Fact
Remote Exchange Daemon) came to life. Alfred is capable of distributing
information over your mesh network in a decentralized fashion, for example
graph information for vis, but also any other data which appears to be useful
- like hostnames, phone books, administration information, DNS information,
the local weather forecast, etc while requiring (almost) zero configuration.
As the development on the core functionality has been finished and alfred works
(at least on the developers boxes), we would like to call for an open beta!
There are bleeding edge downloads and an OpenWRT feed available [1]. Please
try alfred and report bugs, send patches and inform us about your experiences.
Alfred will be release along with the next batman-adv release.
Happy routing,
The B.A.T.M.A.N. team
[1] http://www.open-mesh.org/projects/open-mesh/wiki/Alfred#Download
9 years, 6 months
[B.A.T.M.A.N.] [PATCH] batman-adv: refine API calls for unicast transmissions of SKBs
by Linus Lüssing
With this patch the functions batadv_send_skb_unicast() and
batadv_send_skb_unicast_4addr() are further refined into
batadv_send_skb_tt(), batadv_send_skb_tt_4addr() and
batadv_send_skb_gw(). This way we avoid any guessing about where to send
a packet in the unicast forwarding methods and let the callers decide.
This is going to be useful for the upcoming multicast related patches in
particular.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
---
distributed-arp-table.c | 7 ++--
send.c | 88 ++++++++++++++++++++++++++++++++++++++---------
send.h | 52 ++++++++++++++++++----------
soft-interface.c | 6 +++-
4 files changed, 112 insertions(+), 41 deletions(-)
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
index f2543c2..5399c29 100644
--- a/distributed-arp-table.c
+++ b/distributed-arp-table.c
@@ -1026,11 +1026,10 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
* that a node not using the 4addr packet format doesn't support it.
*/
if (hdr_size == sizeof(struct batadv_unicast_4addr_packet))
- err = batadv_send_skb_unicast_4addr(bat_priv, skb_new,
- BATADV_P_DAT_CACHE_REPLY,
- vid);
+ err = batadv_send_skb_tt_4addr(bat_priv, skb_new,
+ BATADV_P_DAT_CACHE_REPLY, vid);
else
- err = batadv_send_skb_unicast(bat_priv, skb_new, vid);
+ err = batadv_send_skb_tt(bat_priv, skb_new, vid);
if (!err) {
batadv_inc_counter(bat_priv, BATADV_CNT_DAT_CACHED_REPLY_TX);
diff --git a/send.c b/send.c
index b631355..c9c33d8 100644
--- a/send.c
+++ b/send.c
@@ -235,36 +235,34 @@ out:
}
/**
- * batadv_send_generic_unicast_skb - send an skb as unicast
+ * batadv_send_skb_unicast - encapsulate and send an skb via unicast
* @bat_priv: the bat priv with all the soft interface information
* @skb: payload to send
* @packet_type: the batman unicast packet type to use
* @packet_subtype: the unicast 4addr packet subtype (only relevant for unicast
* 4addr packets)
+ * @orig_node: the originator to send the packet to
* @vid: the vid to be used to search the translation table
*
- * Returns 1 in case of error or 0 otherwise.
+ * Wrap the given skb into a batman-adv unicast or unicast-4addr header
+ * depending on whether BATADV_UNICAST or BATADV_UNICAST_4ADDR was supplied
+ * as packet_type.
+ *
+ * Then send this frame to the given orig_node and release a reference to
+ * this orig_node.
+ *
+ * Return 1 in case of error or 0 otherwise.
*/
-int batadv_send_skb_generic_unicast(struct batadv_priv *bat_priv,
- struct sk_buff *skb, int packet_type,
- int packet_subtype,
- unsigned short vid)
+static int batadv_send_skb_unicast(struct batadv_priv *bat_priv,
+ struct sk_buff *skb, int packet_type,
+ int packet_subtype,
+ struct batadv_orig_node *orig_node,
+ unsigned short vid)
{
struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
struct batadv_unicast_packet *unicast_packet;
- struct batadv_orig_node *orig_node;
int ret = NET_RX_DROP;
- /* get routing information */
- if (is_multicast_ether_addr(ethhdr->h_dest))
- orig_node = batadv_gw_get_selected_orig(bat_priv);
- else
- /* check for tt host - increases orig_node refcount.
- * returns NULL in case of AP isolation
- */
- orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
- ethhdr->h_dest, vid);
-
if (!orig_node)
goto out;
@@ -304,6 +302,62 @@ out:
return ret;
}
+/**
+ * batadv_send_skb_generic_tt - send an skb to a translation table node
+ * @bat_priv: the bat priv with all the soft interface information
+ * @skb: payload to send
+ * @packet_type: the batman unicast packet type to use
+ * @packet_subtype: the unicast 4addr packet subtype (only relevant for unicast
+ * 4addr packets)
+ * @vid: the vid to be used to search the translation table
+ *
+ * Look up the destination node for the destination address in the ethernet
+ * header via the translation table.
+ *
+ * Wrap the given skb into a batman-adv unicast or unicast-4addr header
+ * depending on whether BATADV_UNICAST or BATADV_UNICAST_4ADDR was supplied
+ * as packet_type.
+ *
+ * Then send this frame to the according destination node.
+ *
+ * Return 1 in case of error or 0 otherwise.
+ */
+int batadv_send_skb_generic_tt(struct batadv_priv *bat_priv,
+ struct sk_buff *skb, int packet_type,
+ int packet_subtype, unsigned short vid)
+{
+ struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
+ struct batadv_orig_node *orig_node;
+
+ orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
+ ethhdr->h_dest, vid);
+ return batadv_send_skb_unicast(bat_priv, skb, packet_type,
+ packet_subtype, orig_node, vid);
+}
+
+/**
+ * batadv_send_skb_gw - send an skb to a gateway node
+ * @bat_priv: the bat priv with all the soft interface information
+ * @skb: payload to send
+ * @vid: the vid to be used to search the translation table
+ *
+ * Look up the currently selected gateway.
+ *
+ * Wrap the given skb into a batman-adv unicast header and send this frame
+ * to this gateway node.
+ *
+ * Return 1 in case of error or 0 otherwise.
+ */
+int batadv_send_skb_gw(struct batadv_priv *bat_priv, struct sk_buff *skb,
+ unsigned short vid)
+{
+ struct batadv_orig_node *orig_node;
+
+ orig_node = batadv_gw_get_selected_orig(bat_priv);
+ return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST, 0,
+ orig_node, vid);
+}
+
void batadv_schedule_bat_ogm(struct batadv_hard_iface *hard_iface)
{
struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
diff --git a/send.h b/send.h
index c030cb7..87c4426 100644
--- a/send.h
+++ b/send.h
@@ -38,45 +38,59 @@ bool batadv_send_skb_prepare_unicast_4addr(struct batadv_priv *bat_priv,
struct sk_buff *skb,
struct batadv_orig_node *orig_node,
int packet_subtype);
-int batadv_send_skb_generic_unicast(struct batadv_priv *bat_priv,
- struct sk_buff *skb, int packet_type,
- int packet_subtype,
- unsigned short vid);
+int batadv_send_skb_generic_tt(struct batadv_priv *bat_priv,
+ struct sk_buff *skb, int packet_type,
+ int packet_subtype, unsigned short vid);
+int batadv_send_skb_gw(struct batadv_priv *bat_priv, struct sk_buff *skb,
+ unsigned short vid);
/**
- * batadv_send_unicast_skb - send the skb encapsulated in a unicast packet
+ * batadv_send_skb_tt - send an skb to a translation table node
* @bat_priv: the bat priv with all the soft interface information
* @skb: the payload to send
* @vid: the vid to be used to search the translation table
*
+ * Look up the destination node for the destination address in the ethernet
+ * header via the translation table.
+ *
+ * Wrap the given skb into a batman-adv unicast header.
+ *
+ * Then send this frame to the according destination node.
+ *
* Returns 1 in case of error or 0 otherwise.
*/
-static inline int batadv_send_skb_unicast(struct batadv_priv *bat_priv,
- struct sk_buff *skb,
- unsigned short vid)
+static inline int batadv_send_skb_tt(struct batadv_priv *bat_priv,
+ struct sk_buff *skb,
+ unsigned short vid)
{
- return batadv_send_skb_generic_unicast(bat_priv, skb, BATADV_UNICAST,
- 0, vid);
+ return batadv_send_skb_generic_tt(bat_priv, skb, BATADV_UNICAST, 0,
+ vid);
}
/**
- * batadv_send_4addr_unicast_skb - send the skb encapsulated in a unicast 4addr
- * packet
+ * batadv_send_skb_tt_4addr - send an skb to a translation table node
* @bat_priv: the bat priv with all the soft interface information
* @skb: the payload to send
* @packet_subtype: the unicast 4addr packet subtype to use
* @vid: the vid to be used to search the translation table
*
+ * Look up the destination node for the destination address in the ethernet
+ * header via the translation table.
+ *
+ * Wrap the given skb into a batman-adv unicast-4addr header.
+ *
+ * Then send this frame to the according destination node.
+ *
* Returns 1 in case of error or 0 otherwise.
*/
-static inline int batadv_send_skb_unicast_4addr(struct batadv_priv *bat_priv,
- struct sk_buff *skb,
- int packet_subtype,
- unsigned short vid)
+static inline int batadv_send_skb_tt_4addr(struct batadv_priv *bat_priv,
+ struct sk_buff *skb,
+ int packet_subtype,
+ unsigned short vid)
{
- return batadv_send_skb_generic_unicast(bat_priv, skb,
- BATADV_UNICAST_4ADDR,
- packet_subtype, vid);
+ return batadv_send_skb_generic_tt(bat_priv, skb,
+ BATADV_UNICAST_4ADDR,
+ packet_subtype, vid);
}
#endif /* _NET_BATMAN_ADV_SEND_H_ */
diff --git a/soft-interface.c b/soft-interface.c
index d897194..e84ef45 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -289,7 +289,11 @@ static int batadv_interface_tx(struct sk_buff *skb,
batadv_dat_snoop_outgoing_arp_reply(bat_priv, skb);
- ret = batadv_send_skb_unicast(bat_priv, skb, vid);
+ if (is_multicast_ether_addr(ethhdr->h_dest))
+ ret = batadv_send_skb_gw(bat_priv, skb, vid);
+ else
+ ret = batadv_send_skb_tt(bat_priv, skb, vid);
+
if (ret != 0)
goto dropped_freed;
}
--
1.7.10.4
9 years, 7 months
[B.A.T.M.A.N.] single radio routers and ap/adhoc interfaces
by jonsmirl@gmail.com
I'd like to setup batman up on single radio routers. I've installed
openwrt on three different chipsets now (RT3050, RT5350, AR9331) and
none of these wireless drivers implements support for simultaneous
adhoc and ap mode on virtual interfaces.
Yet when I google around I see lots of examples of people using single
radio routers with dual adhoc and ap mode virtual interfaces. So
which radios support simultaneous adhoc/ap mode?
>From AR9331...
valid interface combinations:
* #{ managed, WDS, P2P-client } <= 2048, #{ AP, mesh point, P2P-GO }
<= 8, #{ IBSS } <= 1,
total <= 2048, #channels <= 1, STA/AP BI must match
* #{ AP } <= 1,
total <= 1, #channels <= 1, STA/AP BI must match, radar detect
widths: { 20 MHz (no HT), 20 MHz }
--
Jon Smirl
jonsmirl(a)gmail.com
9 years, 7 months
[B.A.T.M.A.N.] [PATCHv10 0/3] TT-VLAN: First patchset
by Antonio Quartulli
Hello folks,
after version 4 I decided to split the bug TT-VLAN batch in several patchsets to
make them easier to get digested by the maintainers.
This is the fourth iteration of the first patchset.
Difference from v9:
- added rcu_read_lock()/unlock() to batadv_kobj_to_vlan()
Difference from v8:
- remove bat_priv->ap_isolation and converts code using it to use
vlan->ap_isolation
Difference from v7:
- fixed refcounting for mesh_obj (must be increased when used by the untagged
LAN)
- added kernel doc for batadv_softif_destroy_vlan()
- added kernel doc for batadv_vlan_kobj_to_batpriv()
- moved changes to sysfs routine from patch 3/3 to 2/3. In this way patch 2 is
the only one manipulating the sysfs framework
Differences from v6:
- added patch introducing the per-VLAN ap_isolation attribute. It made no sense
to have the new framework without a user. This patch introduces it.
- removed the "novlan" sysfs folder. To avoid confusion and keep backward
compatibility in a sane way, attributes corresponding to the untagged LAN are
located in the root sysfs mesh folder (as it was done before). To implement
this, some changes to the sysfs routines were needed (with respect to v6).
- the array used to build the sysfs subfolder name now has a proper size instead
of a too generic "256".
Differences from v5 are:
- added "untagged VLAN" removal routine. In the previous code the "untagged
VLAN" was added but never removed.
- use the correct vid argument when invoking batadv_tt_local_remove(). One
invocation to the mentioned function was getting a vid that was not ORed with
the HAS_TAG flag. However, such invocation has been enclosed into the new
batadv_softif_destroy_vlan() function introduced to account the previous
point.
- bat_priv->softif_vlan_list is now an hlist instead of of a list.
Thanks to Marek for his feedback.
Antonio Quartulli (3):
batman-adv: add per VLAN interface attribute framework
batman-adv: add sysfs framework for VLAN
batman-adv: make the AP isolation attribute VLAN specific
compat.c | 9 +++
compat.h | 24 +++++++
hard-interface.c | 2 +
main.c | 5 +-
soft-interface.c | 176 +++++++++++++++++++++++++++++++++++++++++++++++++-
soft-interface.h | 4 ++
sysfs-class-net-mesh | 5 +-
sysfs.c | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++-
sysfs.h | 10 +++
translation-table.c | 27 ++++++--
translation-table.h | 2 +-
types.h | 25 +++++++-
12 files changed, 448 insertions(+), 19 deletions(-)
--
1.8.1.5
9 years, 7 months
[B.A.T.M.A.N.] [PATCHv9 0/3] TT-VLAN: First patchset
by Antonio Quartulli
Hello folks,
after version 4 I decided to split the bug TT-VLAN batch in several patchsets to
make them easier to get digested by the maintainers.
This is the fourth iteration of the first patchset.
Difference from v8:
- remove bat_priv->ap_isolation and converts code using it to use
vlan->ap_isolation
Difference from v7:
- fixed refcounting for mesh_obj (must be increased when used by the untagged
LAN)
- added kernel doc for batadv_softif_destroy_vlan()
- added kernel doc for batadv_vlan_kobj_to_batpriv()
- moved changes to sysfs routine from patch 3/3 to 2/3. In this way patch 2 is
the only one manipulating the sysfs framework
Differences from v6:
- added patch introducing the per-VLAN ap_isolation attribute. It made no sense
to have the new framework without a user. This patch introduces it.
- removed the "novlan" sysfs folder. To avoid confusion and keep backward
compatibility in a sane way, attributes corresponding to the untagged LAN are
located in the root sysfs mesh folder (as it was done before). To implement
this, some changes to the sysfs routines were needed (with respect to v6).
- the array used to build the sysfs subfolder name now has a proper size instead
of a too generic "256".
Differences from v5 are:
- added "untagged VLAN" removal routine. In the previous code the "untagged
VLAN" was added but never removed.
- use the correct vid argument when invoking batadv_tt_local_remove(). One
invocation to the mentioned function was getting a vid that was not ORed with
the HAS_TAG flag. However, such invocation has been enclosed into the new
batadv_softif_destroy_vlan() function introduced to account the previous
point.
- bat_priv->softif_vlan_list is now an hlist instead of of a list.
Thanks to Marek for his feedback.
Antonio Quartulli (3):
batman-adv: add per VLAN interface attribute framework
batman-adv: add sysfs framework for VLAN
batman-adv: make the AP isolation attribute VLAN specific
compat.c | 9 +++
compat.h | 24 +++++++
hard-interface.c | 2 +
main.c | 5 +-
soft-interface.c | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++-
soft-interface.h | 4 ++
sysfs-class-net-mesh | 5 +-
sysfs.c | 175 +++++++++++++++++++++++++++++++++++++++++++++++++-
sysfs.h | 10 +++
translation-table.c | 27 ++++++--
translation-table.h | 2 +-
types.h | 25 +++++++-
12 files changed, 445 insertions(+), 19 deletions(-)
--
1.8.1.5
9 years, 7 months