Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
---
README | 41 ++++++++++++++++++++---------------------
1 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/README b/README
index d11c6d3..442f8b6 100644
--- a/README
+++ b/README
@@ -18,8 +18,8 @@ settings.
How does it work ?
==================
-batctl uses the /dev/batman-adv device provided by the B.A.T.M.A.N. advanced
-kernel module to inject custom icmp packets into the data flow. That's why
+batctl uses the debugfs/batman_adv/bat0/socket device provided by the B.A.T.M.A.N.
+advanced kernel module to inject custom icmp packets into the data flow. That's why
ping and traceroute work almost like their IP based counterparts. Tcpdump was
designed because B.A.T.M.A.N. advanced encapsulates all traffic within batman
packets, so that the normal tcpdump would not recognize the packets.
@@ -30,8 +30,8 @@ The bat-hosts file
This file is simliar to the /etc/hosts file. You can write one MAC address and
one host name per line. batctl will analyze the file to find the matching MAC
-address to your provided host name. Host names are much easier to remember
-than MAC addresses. ;)
+address to your provided host name. Host names are much easier to remember than
+MAC addresses. ;)
batctl ping
@@ -45,6 +45,7 @@ options:
-h print this help
-i interval in seconds
-t timeout in seconds
+ -R record route
Example:
@@ -95,8 +96,9 @@ options:
4 - batman unicast packets
8 - batman broadcast packets
16 - batman vis packets
- 32 - non batman packets
- 33 - batman ogm & non batman packets
+ 32 - batman fragmented packets
+ 64 - non batman packets
+ 65 - batman ogm & non batman packets
Example output for tcpdump:
@@ -241,12 +243,12 @@ batctl interface
display or modify the interface settings
-Usage: batctl interface|if [none|interface]
+Usage: batctl interface|if [add|del iface(s)]
Example:
$ batctl interface
-[ active] eth0 fe:fe:00:00:01:01
+eth0: active
batctl interval
===============
@@ -270,7 +272,6 @@ Usage: batctl log|l
Example:
$ batctl log
-r)
[ 400] Received BATMAN packet via NB: fe:fe:00:00:02:01 IF: eth0 [fe:fe:00:00:01:01] (from OG: fe:fe:00:00:01:01 via prev OG: fe:fe:00:00:01:01 seqno 670, tq 245, TTL 49, V 8, IDF 1)
[ 400] Drop packet: originator packet from myself (via neighbour)
[ 400] Received BATMAN packet via NB: fe:fe:00:00:02:01 IF: eth0 [fe:fe:00:00:01:01] (from OG: fe:fe:00:00:02:01 via prev OG: fe:fe:00:00:02:01 seqno 545, tq 255, TTL 50, V 8, IDF 0)
@@ -285,15 +286,14 @@ batctl loglevel
display or modify the log level
-Usage: batctl |ll [level]
+Usage: batctl loglevel|ll [level]
Example:
$ batctl loglevel
-[x] critical (0)
-[x] warnings (1)
-[x] notices (2)
-[x] batman (4)
-[x] routes (8)
+[x] all debug output disabled (0)
+[ ] messages related to routing / flooding / broadcasting (1)
+[ ] messages related to route or hna added / changed / deleted (2)
+[ ] all debug messages (3)
batctl aggregation
==================
@@ -334,18 +334,17 @@ Globally announced TT entries received via the mesh (translation table):
* 86:4b:b2:d2:00:00 via fe:fe:00:00:07:01
* ca:a1:5b:e5:00:00 via fe:fe:00:00:06:01
-batctl vis_server
+batctl vis_mode
=================
display or modify the status of the VIS server
-Usage: batctl vis_server|vs [enabled|disabled]
+Usage: batctl vis_mode|vm [mode]
Example:
-$ batctl vis_server
-[x] client mode (server disabled)
-[ ] server mode (server enabled)
+$ batctl vis_mode
+client
batctl vis_data
@@ -410,7 +409,7 @@ vis-dot to png
--------------
The vis dot output could then further be converted to an image of the topology
-graph, e.g. with the help of the graphviz-tools. The according commands could
+graph, e.g. with the help of the graphviz-tools. The according commands could
then look like this:
$ batctl vis_data dot > /tmp/graph.dot
--
1.7.2.3
Distributions like Gentoo or Debian have to strip the options regarding
the optimisation levels and debugging information to fulfil their
policies. There is currently no valid reason why the Makefile should
override it.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 217a00a..3b9e853 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ endif
endif
CC = gcc
-CFLAGS += -pedantic -Wall -W -g3 -std=gnu99 -Os -fno-strict-aliasing
+CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing
EXTRA_CFLAGS = -DREVISION_VERSION=$(REVISION_VERSION)
LDFLAGS += -lm
--
1.7.5.1
This comment has been wrongly put after the variable it refers to and was also bad indented
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
types.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/types.h b/types.h
index fab70e8..65b3222 100644
--- a/types.h
+++ b/types.h
@@ -246,10 +246,10 @@ struct frag_packet_list_entry {
};
struct vis_info {
- unsigned long first_seen;
- struct list_head recv_list;
- /* list of server-neighbors we received a vis-packet
- * from. we should not reply to them. */
+ unsigned long first_seen;
+ /* list of server-neighbors we received a vis-packet
+ * from. we should not reply to them. */
+ struct list_head recv_list;
struct list_head send_list;
struct kref refcount;
struct hlist_node hash_entry;
--
1.7.3.4
Instead of comparing mac addresses with the broadcast address by means
of compare_eth(), the is_broadcast_ether_addr() kernel function has to be
used.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
routing.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/routing.c b/routing.c
index 07f23ba..90ae6f0 100644
--- a/routing.c
+++ b/routing.c
@@ -661,7 +661,7 @@ void receive_bat_packet(const struct ethhdr *ethhdr,
hard_iface->net_dev->dev_addr))
is_my_oldorig = 1;
- if (compare_eth(ethhdr->h_source, broadcast_addr))
+ if (is_broadcast_ether_addr(ethhdr->h_source))
is_broadcast = 1;
}
rcu_read_unlock();
--
1.7.3.4
smallest_signed_int(), seq_before() and seq_after() are very useful
functions that help to handle comparisons between sequence numbers.
However they were only defined in vis.c. With this patch every
batman-adv function will be able to use them.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
main.h | 16 ++++++++++++++++
vis.c | 16 ----------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/main.h b/main.h
index 3ca3941..90db244 100644
--- a/main.h
+++ b/main.h
@@ -181,4 +181,20 @@ static inline int compare_eth(void *data1, void *data2)
#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
+/* Returns the smallest signed integer in two's complement with the sizeof x */
+#define smallest_signed_int(x) (1u << (7u + 8u * (sizeof(x) - 1u)))
+
+/* Checks if a sequence number x is a predecessor/successor of y.
+ * they handle overflows/underflows and can correctly check for a
+ * predecessor/successor unless the variable sequence number has grown by
+ * more then 2**(bitwidth(x)-1)-1.
+ * This means that for a uint8_t with the maximum value 255, it would think:
+ * - when adding nothing - it is neither a predecessor nor a successor
+ * - before adding more than 127 to the starting value - it is a predecessor,
+ * - when adding 128 - it is neither a predecessor nor a successor,
+ * - after adding more than 127 to the starting value - it is a successor */
+#define seq_before(x, y) ({typeof(x) _dummy = (x - y); \
+ _dummy > smallest_signed_int(_dummy); })
+#define seq_after(x, y) seq_before(y, x)
+
#endif /* _NET_BATMAN_ADV_MAIN_H_ */
diff --git a/vis.c b/vis.c
index c39f20c..e1ed552 100644
--- a/vis.c
+++ b/vis.c
@@ -30,22 +30,6 @@
#define MAX_VIS_PACKET_SIZE 1000
-/* Returns the smallest signed integer in two's complement with the sizeof x */
-#define smallest_signed_int(x) (1u << (7u + 8u * (sizeof(x) - 1u)))
-
-/* Checks if a sequence number x is a predecessor/successor of y.
- * they handle overflows/underflows and can correctly check for a
- * predecessor/successor unless the variable sequence number has grown by
- * more then 2**(bitwidth(x)-1)-1.
- * This means that for a uint8_t with the maximum value 255, it would think:
- * - when adding nothing - it is neither a predecessor nor a successor
- * - before adding more than 127 to the starting value - it is a predecessor,
- * - when adding 128 - it is neither a predecessor nor a successor,
- * - after adding more than 127 to the starting value - it is a successor */
-#define seq_before(x, y) ({typeof(x) _dummy = (x - y); \
- _dummy > smallest_signed_int(_dummy); })
-#define seq_after(x, y) seq_before(y, x)
-
static void start_vis_timer(struct bat_priv *bat_priv);
/* free the info */
--
1.7.3.4
Distributions like Gentoo or Debian have to strip the options regarding
the optimisation levels and debugging information to fulfil their
policies. There is currently no valid reason why the Makefile should
override it.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
This patch depends on other patches submitted earlier:
- vis: Remove obsolete creation of source packages
- vis: Remove subversion/svk revision information
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index c808391..6867a5f 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ endif
endif
CC = gcc
-CFLAGS += -pedantic -Wall -W -O1 -g3 -std=gnu99
+CFLAGS += -pedantic -Wall -W -std=gnu99
EXTRA_CFLAGS = -DDEBUG_MALLOC -DMEMORY_USAGE -DREVISION_VERSION=$(REVISION_VERSION)
LDFLAGS += -lpthread
--
1.7.5.1
Distributions like Gentoo or Debian have to strip the options regarding
the optimisation levels and debugging information to fulfil their
policies. There is currently no valid reason why the Makefile should
override it.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
This patch depends on other patches submitted earlier:
- batmand: Fix FTBFS on second build attempt
- batmand: Remove obsolete creation of source packages
- batmand: Remove subversion/svk revision information
- batmand: Use nproc to get number of available processors
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 4df2872..49342ac 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ endif
#NO_POLICY_ROUTING = -DNO_POLICY_ROUTING
CC = gcc
-CFLAGS += -pedantic -Wall -W -Os -g3 -std=gnu99
+CFLAGS += -pedantic -Wall -W -std=gnu99
EXTRA_CFLAGS = -DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA $(NO_POLICY_ROUTING) -DREVISION_VERSION=$(REVISION_VERSION)
LDFLAGS += -lpthread
--
1.7.5.1
First, my apologies on not monitoring the irc channel.
A bit consumed at work. (if anybody happens to know how to
get the broadcom bcm4329 driver to change channels in ad-hoc mode,
please feel free to share. iwconfig ... channel XX command fails, but
driver code looks correct. Target is HTC Desire).
Regarding fragmentation -- this is strictly coming from the UPD/IPv6.
It it not fragmenting in the wlan driver. I have fragmentation
threshold set off. I'm assuming it is responding to the configuration
parameters correctly.
I'm using Omnipeek on a PC to sniff the packets. The antennas are
about 2 feet apart. The network traffic is relatively low, in the 1 -
10% on average, with virtually no indication of corruption from hidden
nodes or other sources under regular operation. That is, I only see
the CRC error flags set with the broadcast packets at 802.11g data
rates. This is the 802.11 packet CRC, nothing internal to it. The
Omnipeek does not know about the batman-adv protocol. Also, I have
other nodes setup with batman-adv which are
repeating the broadcasts. I can see that only the packets without the
CRC error flags are being rebroadcast. This indicates to me that the
packets flagged as
CRC errors by Omnipeek are also being dropped as error'ed packets by
the other nodes.
I do not see this problem with packets sent directly to the bcm4329
device. However, I will continue to try to see if I can get that to
happen, would then mean it is bcm4329 driver and hardware problem. At
the moment, using UDP broadcast with IPv4 directly onto the wlan
driver without batman-adv (bat0), I do not see the behavior. I've
been using my own code for this. Noticed netcat and nc last night.
Will try piping with those tools today in both modes, with and without
batman-adv to
reverify what I'm seeing.
I do not know how to do kernel debugging with kdbg/gdb across a USB
port on the target side. I do not have JTAG or serial access.
Google'd for how to setup the kernel to use USB port for kdbg, but did
not find anything. Just lots of info on how to debug the USB driver
itself.
I'm using the cyanogenmod version of Android with the HTC Desire
version of the Linux kernel, and the insertion of modules like
batman-adv. I did verify that the modules are being built against the
correct Linux kernel sources, just in case there was something silly
going on.
I'm building with NETCONSOLE enabled today and hope to be able to see
driver messages sent over the WLAN using netcat on the host side.
That should allow me to see both batman-adv and the bcm4329 trace
messages. I should also be able to send the console to ttyUSB0,
assuming I can get the HTC Desire USB to behave properly.
I'll change the line to skb_copy as was suggested by <T_x>? and Sven.
Will post my results.
Thanks for the follow up.
David Beberman
Hi,
Paul E. McKenney <paulmck(a)linux.vnet.ibm.com> proposed some changes
which will reduce the amount of "kfree only" rcu-callback functions. The
batman-adv compatibility layer has to add a similar functionality to
support older kernels.
I wanted to propose a solution which should be discussed before the
kfree_rcu functionality enters Linus' kernel and our master branch.
The amount of kfree_rcu_* function was reduced to support only a maximum
offset of 256 to any 'struct rcu_head' inside a struct. This should be
enough for the current version and supported architectures. Offsets of
4096 are supported by Paul E. McKenney's implementation, but our
workaround would increase the size of the final module too much
(personal opinion).
~~~ These patches should *NOT* enter the batman-adv repo right now ~~~~~
Kind regards,
Sven