Hello,
This is a second version of the TT patchset I recently sent.
In this case I decided to rearrange the patches. Pathces listed here are not
improvements, but they are fixes that should go into batman-adv/next.
The remaining patches, which are improvements intended for batman-adv/master,
will be sent in another patchset soon.
Thank you,
Antonio Quartulli (5):
batman-adv: fix TT packet rerouting
batman-adv: fix debug message
batman-adv: remove useless goto
batman-adv: send ROAMING_ADV once
batman-adv: fix local client recognition in is_my_client()
routing.c | 36 ++++++++++++++++++++++++++----------
translation-table.c | 10 ++++++----
2 files changed, 32 insertions(+), 14 deletions(-)
--
1.8.0
Hi,
I'm new to B.A.T.M.A.N, so a "Hello" to all! :)
Does B.A.T.M.A.N support some kind of broadcasting node positions?
The idea is to broadcast TX-Power/RX-Gain and the position of a node
determined by a GPS-device to create maps with network coverage.
Is that possible anyhow?
Regards,
Renne
In tt_global_add() the ROAM flag is improperly unset. This makes the
next check fail and so preventing emptying the old originator_list for
the involved tt_global_entry
This was introduced by ("batman-adv: roaming handling mechanism redesign")
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
This patch should go to next so that it can be squashed with the one introducing
the "broken" change.
translation-table.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/translation-table.c b/translation-table.c
index 6fecb94..f30360c 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -860,14 +860,6 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv,
*/
common->flags &= ~BATADV_TT_CLIENT_TEMP;
- /* if this is a normal add, possibly unset the ROAM flag. This
- * flag could have been set before because the client was
- * roaming, but now that the node got the ADD event, the flag
- * can be unset
- */
- if (!(flags & BATADV_TT_CLIENT_ROAM))
- common->flags &= ~BATADV_TT_CLIENT_ROAM;
-
/* If there is the BATADV_TT_CLIENT_ROAM flag set, there is only
* one originator left in the list and we previously received a
* delete + roaming change for this originator.
--
1.8.0
From: Linus Lüssing <linus.luessing(a)web.de>
commit 7f112af40fecf5399b61e69ffc6b55a9d82789f7 upstream.
So far the crc16 checksum for a batman-adv broadcast data packet, received
on a batman-adv hard interface, was calculated over zero bytes of its
content leading to many incoming broadcast data packets wrongly being
dropped (60-80% packet loss).
This patch fixes this issue by calculating the crc16 over the actual,
complete broadcast payload.
The issue is a regression introduced by
("batman-adv: add broadcast duplicate check").
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
Acked-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
net/batman-adv/bridge_loop_avoidance.c | 16 +++++++---------
net/batman-adv/routing.c | 8 +++++++-
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index c5863f4..740bb6f 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1172,8 +1172,8 @@ int bla_init(struct bat_priv *bat_priv)
/**
* @bat_priv: the bat priv with all the soft interface information
- * @bcast_packet: originator mac address
- * @hdr_size: maximum length of the frame
+ * @bcast_packet: encapsulated broadcast frame plus batman header
+ * @bcast_packet_len: length of encapsulated broadcast frame plus batman header
*
* check if it is on our broadcast list. Another gateway might
* have sent the same packet because it is connected to the same backbone,
@@ -1183,19 +1183,17 @@ int bla_init(struct bat_priv *bat_priv)
* with a good chance that it is the same packet. If it is furthermore
* sent by another host, drop it. We allow equal packets from
* the same host however as this might be intended.
- *
- **/
-
-int bla_check_bcast_duplist(struct bat_priv *bat_priv,
- struct bcast_packet *bcast_packet,
- int hdr_size)
+ */
+int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
+ struct batadv_bcast_packet *bcast_packet,
+ int bcast_packet_len)
{
int i, length, curr;
uint8_t *content;
uint16_t crc;
struct bcast_duplist_entry *entry;
- length = hdr_size - sizeof(*bcast_packet);
+ length = bcast_packet_len - sizeof(*bcast_packet);
content = (uint8_t *)bcast_packet;
content += sizeof(*bcast_packet);
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 015471d..0c2cb6b 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -1081,8 +1081,14 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
spin_unlock_bh(&orig_node->bcast_seqno_lock);
+ /* keep skb linear for crc calculation */
+ if (skb_linearize(skb) < 0)
+ goto out;
+
+ bcast_packet = (struct batadv_bcast_packet *)skb->data;
+
/* check whether this has been sent by another originator before */
- if (bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size))
+ if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, skb->len))
goto out;
/* rebroadcast packet */
--
1.8.0
Hello David,
here you have another patchset with two new features intended for
net-next/linux-3.8.
Patch 1/9 adds the new UNICAST_4ADDR packet type which contains both the source
and the destination node addresses (unlike the classic UNICAST which contains
the destination only) and can encapsulate different packet subtypes.
Then all the remaining patches introduce the new Distributed ARP Table (DAT)
component. It is the first user of the new packet type introduced by 1/9.
DAT is the results of Antonio Quartulli's Google Summer Of Code 2011.
It was already sent to netdev once in the past, but got rejected because of its
dependency on the ARP/neigh layer internals. In this new version a batman-adv
private ARP storage has been implemented, so dropping any possible relationship
with the inner neigh code.
Please, let me know if there is any problem.
Thank you very much,
Antonio
The following changes since commit b77bc2069d1e437d5a1a71bb5cfcf4556ee40015:
ppp: make ppp_get_stats64 static (2012-11-01 12:38:31 -0400)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batman-adv-for-davem
for you to fetch changes up to f113f61fd0af6dfd08f8110236cd47c410b36711:
batman-adv: Add get_ethtool_stats() support for DAT (2012-11-02 21:50:15 +0100)
----------------------------------------------------------------
Included changes:
- new packet type called UNICAST_4ADDR: in this packet it is possible to find
both source and destination node (in the classic UNICAST header only the
destination field exists).
- a new feature: Distributed ARP Table (D.A.T.). It aims to reduce ARP lookups
latency by means of a simil-DHT approach.
----------------------------------------------------------------
Antonio Quartulli (8):
batman-adv: add UNICAST_4ADDR packet type
batman-adv: Distributed ARP Table - add a new debug log level
batman-adv: Distributed ARP Table - create DHT helper functions
batman-adv: Distributed ARP Table - implement local storage
batman-adv: Distributed ARP Table - add ARP parsing functions
batman-adv: Distributed ARP Table - add snooping functions for ARP messages
batman-adv: Distributed ARP Table - add compile option
batman-adv: Distributed ARP Table - add runtime switch
Martin Hundebøll (1):
batman-adv: Add get_ethtool_stats() support for DAT
Documentation/networking/batman-adv.txt | 3 +-
net/batman-adv/Kconfig | 10 +
net/batman-adv/Makefile | 1 +
net/batman-adv/debugfs.c | 20 +
net/batman-adv/distributed-arp-table.c | 1066 +++++++++++++++++++++++++++++++
net/batman-adv/distributed-arp-table.h | 167 +++++
net/batman-adv/hard-interface.c | 3 +
net/batman-adv/main.c | 9 +
net/batman-adv/main.h | 13 +-
net/batman-adv/originator.c | 2 +
net/batman-adv/packet.h | 43 +-
net/batman-adv/routing.c | 41 +-
net/batman-adv/send.c | 4 +
net/batman-adv/soft-interface.c | 28 +-
net/batman-adv/sysfs.c | 7 +
net/batman-adv/types.h | 73 +++
net/batman-adv/unicast.c | 134 +++-
net/batman-adv/unicast.h | 36 +-
18 files changed, 1631 insertions(+), 29 deletions(-)
create mode 100644 net/batman-adv/distributed-arp-table.c
create mode 100644 net/batman-adv/distributed-arp-table.h
From: Linus Lüssing <linus.luessing(a)web.de>
commit 7f112af40fecf5399b61e69ffc6b55a9d82789f7 upstream.
So far the crc16 checksum for a batman-adv broadcast data packet, received
on a batman-adv hard interface, was calculated over zero bytes of its
content leading to many incoming broadcast data packets wrongly being
dropped (60-80% packet loss).
This patch fixes this issue by calculating the crc16 over the actual,
complete broadcast payload.
The issue is a regression introduced by
("batman-adv: add broadcast duplicate check").
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
Acked-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
net/batman-adv/bridge_loop_avoidance.c | 8 ++++----
net/batman-adv/routing.c | 8 +++++++-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 6705d35..e7b5777 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1205,8 +1205,8 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
/**
* batadv_bla_check_bcast_duplist
* @bat_priv: the bat priv with all the soft interface information
- * @bcast_packet: originator mac address
- * @hdr_size: maximum length of the frame
+ * @bcast_packet: encapsulated broadcast frame plus batman header
+ * @bcast_packet_len: length of encapsulated broadcast frame plus batman header
*
* check if it is on our broadcast list. Another gateway might
* have sent the same packet because it is connected to the same backbone,
@@ -1219,14 +1219,14 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
*/
int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
struct batadv_bcast_packet *bcast_packet,
- int hdr_size)
+ int bcast_packet_len)
{
int i, length, curr;
uint8_t *content;
uint16_t crc;
struct batadv_bcast_duplist_entry *entry;
- length = hdr_size - sizeof(*bcast_packet);
+ length = bcast_packet_len - sizeof(*bcast_packet);
content = (uint8_t *)bcast_packet;
content += sizeof(*bcast_packet);
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index bc2b88b..f861b7c 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -1136,8 +1136,14 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
spin_unlock_bh(&orig_node->bcast_seqno_lock);
+ /* keep skb linear for crc calculation */
+ if (skb_linearize(skb) < 0)
+ goto out;
+
+ bcast_packet = (struct batadv_bcast_packet *)skb->data;
+
/* check whether this has been sent by another originator before */
- if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size))
+ if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, skb->len))
goto out;
/* rebroadcast packet */
--
1.8.0