r1462 - trunk/batman-adv-kernelland
by postmaster@open-mesh.net
Author: simon
Date: 2009-11-07 10:59:00 +0000 (Sat, 07 Nov 2009)
New Revision: 1462
Modified:
trunk/batman-adv-kernelland/Makefile
trunk/batman-adv-kernelland/Makefile.kbuild
trunk/batman-adv-kernelland/README
trunk/batman-adv-kernelland/aggregation.c
trunk/batman-adv-kernelland/aggregation.h
trunk/batman-adv-kernelland/bitarray.c
trunk/batman-adv-kernelland/bitarray.h
trunk/batman-adv-kernelland/compat.h
trunk/batman-adv-kernelland/device.c
trunk/batman-adv-kernelland/device.h
trunk/batman-adv-kernelland/hard-interface.c
trunk/batman-adv-kernelland/hard-interface.h
trunk/batman-adv-kernelland/hash.c
trunk/batman-adv-kernelland/hash.h
trunk/batman-adv-kernelland/log.c
trunk/batman-adv-kernelland/log.h
trunk/batman-adv-kernelland/main.c
trunk/batman-adv-kernelland/main.h
trunk/batman-adv-kernelland/packet.h
trunk/batman-adv-kernelland/proc.c
trunk/batman-adv-kernelland/proc.h
trunk/batman-adv-kernelland/ring_buffer.c
trunk/batman-adv-kernelland/ring_buffer.h
trunk/batman-adv-kernelland/routing.c
trunk/batman-adv-kernelland/routing.h
trunk/batman-adv-kernelland/send.c
trunk/batman-adv-kernelland/send.h
trunk/batman-adv-kernelland/soft-interface.c
trunk/batman-adv-kernelland/soft-interface.h
trunk/batman-adv-kernelland/translation-table.c
trunk/batman-adv-kernelland/translation-table.h
trunk/batman-adv-kernelland/types.h
trunk/batman-adv-kernelland/vis.c
trunk/batman-adv-kernelland/vis.h
Log:
update README and adjust year numbers in copyright notice
Modified: trunk/batman-adv-kernelland/Makefile
===================================================================
--- trunk/batman-adv-kernelland/Makefile 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/Makefile 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
#
-# Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+# Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+#
# Marek Lindner, Simon Wunderlich
+#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/Makefile.kbuild
===================================================================
--- trunk/batman-adv-kernelland/Makefile.kbuild 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/Makefile.kbuild 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
#
-# Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+# Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+#
# Marek Lindner, Simon Wunderlich
+#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/README
===================================================================
--- trunk/batman-adv-kernelland/README 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/README 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,11 +1,20 @@
-[state: 17-11-2008]
+[state: 07-11-2009]
BATMAN-ADV
----------
-The kernel implementation of batman-advanced. It does not depend on any network
-driver, and can be used on wifi as well as ethernet, vpn, etc ... (anything
-with ethernet-style layer 2).
+Batman-advanced is a new approach to wireless networking which does no longer
+operate on the IP basis. Unlike B.A.T.M.A.N, which exchanges information
+using UDP packets and sets routing tables, batman-advanced operates on ISO/OSI
+Layer 2 only and uses and routes (or better: bridges) Ethernet Frames. It
+emulates a virtual network switch of all nodes participating. Therefore all
+nodes appear to be link local, thus all higher operating protocols won't be
+affected by any changes within the network. You can run almost any protocol
+above B.A.T.M.A.N. Advanced, prominent examples are: IPv4, IPv6, DHCP, IPX.
+
+This is batman-advanced implemented as Linux kernel driver. It does not depend
+on any network (other) driver, and can be used on wifi as well as ethernet,
+vpn, etc ... (anything with ethernet-style layer 2).
It compiles against and should work with Linux 2.6.20 - 2.6.31. Supporting older
versions is not planned, but it's probably easy to backport it. If you work on a
backport, feel free to contact us. :-)
@@ -53,18 +62,54 @@
# echo "server" > /proc/net/batman-adv/vis
+Each node is either configured as "server" or as "client" (default:
+"client"). Clients send their topology data to the server next to them,
+and server synchronize with other servers. If there is no server
+configured (default) within the mesh, no topology information will be
+transmitted. With these "synchronizing servers", there can be 1 or
+more vis servers sharing the same (or at least very similar) data.
+
When configured as server, you can get a topology snapshot of your mesh:
# cat /proc/net/batman-adv/vis
-This output can be processed with graphviz-tools like dot.
+This output format is a graphviz formatted text file which can be
+processed with graphviz-tools like dot.
The labels are similar/compatible to the ETX metric, 1.0 means perfect
connection (100%), 2.0 means 50%, 3.0 means 33% and so on.
+Alternatively, a JSON output format is available. The format can be set
+using by writing either "dot_draw" or "json" into the vis_format file.
+"dot_draw" is selected by default.
+
+echo "json" > /proc/net/batman-adv/vis_format
+
+In very mobile scenarios, you might want to adjust the originator
+interval to a lower value. This will make the mesh more responsive to
+topology changes, but will also increase the overhead. Please make sure
+that all nodes in your mesh use the same interval. The default value
+is 1000 ms (1 second).
+
+# echo 1000 > /proc/net/batman-adv/orig_interval
+
To deactivate batman, do:
# echo "" > /proc/net/batman-adv/interfaces
+BATCTL
+------
+
+B.A.T.M.A.N. advanced operates on layer 2 and thus all hosts partici-
+pating in the virtual switch are completely transparent for all proto-
+cols above layer 2. Therefore the common diagnosis tools do not work as
+expected. To overcome these problems batctl was created. At the moment
+the batctl contains ping, traceroute, tcpdump and interfaces to the
+kernel module settings.
+
+For more information, please see the manpage (man batctl).
+
+batctl is available on http://www.open-mesh.net/
+
CONTACT
-------
Modified: trunk/batman-adv-kernelland/aggregation.c
===================================================================
--- trunk/batman-adv-kernelland/aggregation.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/aggregation.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/aggregation.h
===================================================================
--- trunk/batman-adv-kernelland/aggregation.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/aggregation.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/bitarray.c
===================================================================
--- trunk/batman-adv-kernelland/bitarray.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/bitarray.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2006-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2006-2009 B.A.T.M.A.N. contributors:
+ *
* Simon Wunderlich, Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/bitarray.h
===================================================================
--- trunk/batman-adv-kernelland/bitarray.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/bitarray.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2006-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2006-2009 B.A.T.M.A.N. contributors:
+ *
* Simon Wunderlich, Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/compat.h
===================================================================
--- trunk/batman-adv-kernelland/compat.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/compat.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/device.c
===================================================================
--- trunk/batman-adv-kernelland/device.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/device.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/device.h
===================================================================
--- trunk/batman-adv-kernelland/device.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/device.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/hard-interface.c
===================================================================
--- trunk/batman-adv-kernelland/hard-interface.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/hard-interface.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/hard-interface.h
===================================================================
--- trunk/batman-adv-kernelland/hard-interface.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/hard-interface.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/hash.c
===================================================================
--- trunk/batman-adv-kernelland/hash.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/hash.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2006-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2006-2009 B.A.T.M.A.N. contributors:
+ *
* Simon Wunderlich, Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/hash.h
===================================================================
--- trunk/batman-adv-kernelland/hash.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/hash.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2006-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2006-2009 B.A.T.M.A.N. contributors:
+ *
* Simon Wunderlich, Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/log.c
===================================================================
--- trunk/batman-adv-kernelland/log.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/log.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/log.h
===================================================================
--- trunk/batman-adv-kernelland/log.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/log.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/main.c
===================================================================
--- trunk/batman-adv-kernelland/main.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/main.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/main.h
===================================================================
--- trunk/batman-adv-kernelland/main.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/main.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/packet.h
===================================================================
--- trunk/batman-adv-kernelland/packet.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/packet.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/proc.c
===================================================================
--- trunk/batman-adv-kernelland/proc.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/proc.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/proc.h
===================================================================
--- trunk/batman-adv-kernelland/proc.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/proc.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/ring_buffer.c
===================================================================
--- trunk/batman-adv-kernelland/ring_buffer.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/ring_buffer.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/ring_buffer.h
===================================================================
--- trunk/batman-adv-kernelland/ring_buffer.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/ring_buffer.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/routing.c
===================================================================
--- trunk/batman-adv-kernelland/routing.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/routing.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/routing.h
===================================================================
--- trunk/batman-adv-kernelland/routing.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/routing.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/send.c
===================================================================
--- trunk/batman-adv-kernelland/send.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/send.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/send.h
===================================================================
--- trunk/batman-adv-kernelland/send.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/send.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/soft-interface.c
===================================================================
--- trunk/batman-adv-kernelland/soft-interface.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/soft-interface.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/soft-interface.h
===================================================================
--- trunk/batman-adv-kernelland/soft-interface.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/soft-interface.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/translation-table.c
===================================================================
--- trunk/batman-adv-kernelland/translation-table.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/translation-table.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/translation-table.h
===================================================================
--- trunk/batman-adv-kernelland/translation-table.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/translation-table.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/types.h
===================================================================
--- trunk/batman-adv-kernelland/types.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/types.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2007-2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ *
* Marek Lindner, Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/vis.c
===================================================================
--- trunk/batman-adv-kernelland/vis.c 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/vis.c 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2008-2009 B.A.T.M.A.N. contributors:
+ *
* Simon Wunderlich
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
Modified: trunk/batman-adv-kernelland/vis.h
===================================================================
--- trunk/batman-adv-kernelland/vis.h 2009-11-04 23:12:40 UTC (rev 1461)
+++ trunk/batman-adv-kernelland/vis.h 2009-11-07 10:59:00 UTC (rev 1462)
@@ -1,6 +1,8 @@
/*
- * Copyright (C) 2008 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2008-2009 B.A.T.M.A.N. contributors:
+ *
* Simon Wunderlich, Marek Lindner
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
12 years, 7 months
r1472 - trunk/batman-adv-kernelland
by postmaster@open-mesh.net
Author: marek
Date: 2009-11-07 14:10:40 +0000 (Sat, 07 Nov 2009)
New Revision: 1472
Modified:
trunk/batman-adv-kernelland/CHANGELOG
Log:
[batman-adv] update Changelog
Modified: trunk/batman-adv-kernelland/CHANGELOG
===================================================================
--- trunk/batman-adv-kernelland/CHANGELOG 2009-11-07 14:04:18 UTC (rev 1471)
+++ trunk/batman-adv-kernelland/CHANGELOG 2009-11-07 14:10:40 UTC (rev 1472)
@@ -1,3 +1,18 @@
+batman-adv 0.2:
+* support latest kernels (2.6.20 - 2.6.31)
+* temporary routing loops / TTL code bug / ghost entries in originator table fixed
+* internal packet queue for packet aggregation & transmission retry (ARQ)
+ for payload broadcasts added
+* interface detection converted to event based handling to avoid timers
+* major linux coding style adjustments applied
+* all kernel version compatibility functions has been moved to compat.h
+* use random ethernet address generator from the kernel
+* /sys/module/batman_adv/version to export kernel module version
+* vis: secondary interface export for dot draw format + JSON output format added
+* many bugs (alignment issues, race conditions, deadlocks, etc) squashed
+
+ -- Sat, 07 Nov 2009 15:44:31 +0100
+
batman-adv 0.1:
* support latest kernels (2.6.20 - 2.6.28)
12 years, 7 months
r1471 - trunk/batman-adv-kernelland
by postmaster@open-mesh.net
Author: simon
Date: 2009-11-07 14:04:18 +0000 (Sat, 07 Nov 2009)
New Revision: 1471
Modified:
trunk/batman-adv-kernelland/device.c
Log:
unlock in bat_device_add_packet() before returning (thanks Sven)
Modified: trunk/batman-adv-kernelland/device.c
===================================================================
--- trunk/batman-adv-kernelland/device.c 2009-11-07 13:50:40 UTC (rev 1470)
+++ trunk/batman-adv-kernelland/device.c 2009-11-07 14:04:18 UTC (rev 1471)
@@ -306,6 +306,7 @@
/* while waiting for the lock the device_client could have been
* deleted */
if (!device_client_hash[icmp_packet->uid]) {
+ spin_unlock(&device_client->lock);
kfree(device_packet);
return;
}
12 years, 7 months
r1470 - trunk/batman-adv-kernelland
by postmaster@open-mesh.net
Author: marek
Date: 2009-11-07 13:50:40 +0000 (Sat, 07 Nov 2009)
New Revision: 1470
Modified:
trunk/batman-adv-kernelland/proc.c
Log:
Remove unknown escape string \{
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Modified: trunk/batman-adv-kernelland/proc.c
===================================================================
--- trunk/batman-adv-kernelland/proc.c 2009-11-07 13:45:41 UTC (rev 1469)
+++ trunk/batman-adv-kernelland/proc.c 2009-11-07 13:50:40 UTC (rev 1470)
@@ -541,7 +541,7 @@
if (current_format == DOT_DRAW) {
addr_to_string(tmp_addr_str, info->packet.vis_orig);
- seq_printf(seq, "\tsubgraph \"cluster_%s\" \{\n", tmp_addr_str);
+ seq_printf(seq, "\tsubgraph \"cluster_%s\" {\n", tmp_addr_str);
while (if_entries != NULL) {
addr_to_string(tmp_addr_str, if_entries->addr);
12 years, 7 months
r1469 - trunk/batman-adv-kernelland
by postmaster@open-mesh.net
Author: marek
Date: 2009-11-07 13:45:41 +0000 (Sat, 07 Nov 2009)
New Revision: 1469
Modified:
trunk/batman-adv-kernelland/aggregation.c
trunk/batman-adv-kernelland/hard-interface.c
trunk/batman-adv-kernelland/proc.c
trunk/batman-adv-kernelland/routing.c
trunk/batman-adv-kernelland/soft-interface.c
trunk/batman-adv-kernelland/translation-table.c
trunk/batman-adv-kernelland/vis.c
Log:
Mark local symbols as static
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Modified: trunk/batman-adv-kernelland/aggregation.c
===================================================================
--- trunk/batman-adv-kernelland/aggregation.c 2009-11-07 13:29:35 UTC (rev 1468)
+++ trunk/batman-adv-kernelland/aggregation.c 2009-11-07 13:45:41 UTC (rev 1469)
@@ -88,7 +88,7 @@
}
/* create a new aggregated packet and add this packet to it */
-void new_aggregated_packet(unsigned char *packet_buff,
+static void new_aggregated_packet(unsigned char *packet_buff,
int packet_len,
unsigned long send_time,
bool direct_link,
Modified: trunk/batman-adv-kernelland/hard-interface.c
===================================================================
--- trunk/batman-adv-kernelland/hard-interface.c 2009-11-07 13:29:35 UTC (rev 1468)
+++ trunk/batman-adv-kernelland/hard-interface.c 2009-11-07 13:45:41 UTC (rev 1469)
@@ -72,7 +72,7 @@
return min_mtu;
}
-void check_known_mac_addr(uint8_t *addr)
+static void check_known_mac_addr(uint8_t *addr)
{
struct batman_if *batman_if;
char mac_string[ETH_STR_LEN];
@@ -105,7 +105,7 @@
}
/* checks if the interface is up. (returns 1 if it is) */
-int hardif_is_interface_up(char *dev)
+static int hardif_is_interface_up(char *dev)
{
struct net_device *net_dev;
@@ -176,7 +176,7 @@
}
/* (re)activate given interface. */
-void hardif_activate_interface(struct batman_if *batman_if)
+static void hardif_activate_interface(struct batman_if *batman_if)
{
struct sockaddr_ll bind_addr;
int retval;
Modified: trunk/batman-adv-kernelland/proc.c
===================================================================
--- trunk/batman-adv-kernelland/proc.c 2009-11-07 13:29:35 UTC (rev 1468)
+++ trunk/batman-adv-kernelland/proc.c 2009-11-07 13:45:41 UTC (rev 1469)
@@ -30,7 +30,7 @@
#include "vis.h"
#include "compat.h"
-uint8_t vis_format = DOT_DRAW;
+static uint8_t vis_format = DOT_DRAW;
static struct proc_dir_entry *proc_batman_dir, *proc_interface_file;
static struct proc_dir_entry *proc_orig_interval_file, *proc_originators_file;
Modified: trunk/batman-adv-kernelland/routing.c
===================================================================
--- trunk/batman-adv-kernelland/routing.c 2009-11-07 13:29:35 UTC (rev 1468)
+++ trunk/batman-adv-kernelland/routing.c 2009-11-07 13:45:41 UTC (rev 1469)
@@ -46,7 +46,7 @@
static atomic_t data_ready_cond;
atomic_t exit_cond;
-void start_purge_timer(void)
+static void start_purge_timer(void)
{
queue_delayed_work(bat_event_workqueue, &purge_orig_wq, 1 * HZ);
}
@@ -618,7 +618,7 @@
start_purge_timer();
}
-int receive_raw_packet(struct socket *raw_sock, unsigned char *packet_buff, int packet_buff_len)
+static int receive_raw_packet(struct socket *raw_sock, unsigned char *packet_buff, int packet_buff_len)
{
struct kvec iov;
struct msghdr msg;
Modified: trunk/batman-adv-kernelland/soft-interface.c
===================================================================
--- trunk/batman-adv-kernelland/soft-interface.c 2009-11-07 13:29:35 UTC (rev 1468)
+++ trunk/batman-adv-kernelland/soft-interface.c 2009-11-07 13:45:41 UTC (rev 1469)
@@ -68,7 +68,7 @@
return (memcmp(mainIfAddr, mainIfAddr_default, ETH_ALEN) != 0 ? 1 : 0);
}
-int my_skb_push(struct sk_buff *skb, unsigned int len)
+static int my_skb_push(struct sk_buff *skb, unsigned int len)
{
int result = 0;
Modified: trunk/batman-adv-kernelland/translation-table.c
===================================================================
--- trunk/batman-adv-kernelland/translation-table.c 2009-11-07 13:29:35 UTC (rev 1468)
+++ trunk/batman-adv-kernelland/translation-table.c 2009-11-07 13:45:41 UTC (rev 1469)
@@ -32,7 +32,7 @@
atomic_t hna_local_changed;
DEFINE_SPINLOCK(hna_local_hash_lock);
-DEFINE_SPINLOCK(hna_global_hash_lock);
+static DEFINE_SPINLOCK(hna_global_hash_lock);
static DECLARE_DELAYED_WORK(hna_local_purge_wq, hna_local_purge);
Modified: trunk/batman-adv-kernelland/vis.c
===================================================================
--- trunk/batman-adv-kernelland/vis.c 2009-11-07 13:29:35 UTC (rev 1468)
+++ trunk/batman-adv-kernelland/vis.c 2009-11-07 13:45:41 UTC (rev 1469)
@@ -369,7 +369,7 @@
return 0;
}
-void purge_vis_packets(void)
+static void purge_vis_packets(void)
{
struct hash_it_t *hashit = NULL;
struct vis_info *info;
12 years, 7 months
r1468 - trunk/batman-adv-kernelland
by postmaster@open-mesh.net
Author: simon
Date: 2009-11-07 13:29:35 +0000 (Sat, 07 Nov 2009)
New Revision: 1468
Modified:
trunk/batman-adv-kernelland/hard-interface.c
Log:
fix memory leak when there is a problem adding an interface
Modified: trunk/batman-adv-kernelland/hard-interface.c
===================================================================
--- trunk/batman-adv-kernelland/hard-interface.c 2009-11-07 13:21:17 UTC (rev 1467)
+++ trunk/batman-adv-kernelland/hard-interface.c 2009-11-07 13:29:35 UTC (rev 1468)
@@ -400,6 +400,8 @@
return 1;
out:
+ if (batman_if->packet_buff)
+ kfree(batman_if->packet_buff);
kfree(batman_if);
kfree(dev);
return -1;
12 years, 7 months
r1467 - trunk/batman-adv-kernelland
by postmaster@open-mesh.net
Author: simon
Date: 2009-11-07 13:21:17 +0000 (Sat, 07 Nov 2009)
New Revision: 1467
Modified:
trunk/batman-adv-kernelland/bitarray.h
Log:
remove obsolete functions from bitarray.h (thanks Sven)
Modified: trunk/batman-adv-kernelland/bitarray.h
===================================================================
--- trunk/batman-adv-kernelland/bitarray.h 2009-11-07 12:50:34 UTC (rev 1466)
+++ trunk/batman-adv-kernelland/bitarray.h 2009-11-07 13:21:17 UTC (rev 1467)
@@ -24,9 +24,6 @@
#define TYPE_OF_WORD unsigned long
#define WORD_BIT_SIZE (sizeof(TYPE_OF_WORD) * 8)
-/* clear the bits, ready for use */
-void bit_init(TYPE_OF_WORD *seq_bits);
-
/* returns true if the corresponding bit in the given seq_bits indicates true
* and curr_seqno is within range of last_seqno */
uint8_t get_bit_status(TYPE_OF_WORD *seq_bits, uint16_t last_seqno,
@@ -46,6 +43,3 @@
/* count the hamming weight, how many good packets did we receive? */
int bit_packet_count(TYPE_OF_WORD *seq_bits);
-
-/* print the packet array, for debugging purposes */
-char *bit_print(TYPE_OF_WORD *seq_bits);
12 years, 7 months
r1461 - trunk/batctl
by postmaster@open-mesh.net
Author: marek
Date: 2009-11-04 23:12:40 +0000 (Wed, 04 Nov 2009)
New Revision: 1461
Modified:
trunk/batctl/bisect.c
trunk/batctl/bisect.h
Log:
[batctl] bisect - fix wrongly detected routing loops
Modified: trunk/batctl/bisect.c
===================================================================
--- trunk/batctl/bisect.c 2009-11-04 23:12:34 UTC (rev 1460)
+++ trunk/batctl/bisect.c 2009-11-04 23:12:40 UTC (rev 1461)
@@ -251,6 +251,7 @@
rt_hist->prev_rt_hist = NULL;
rt_hist->next_hop = next_hop_node;
rt_hist->flags = rt_flag;
+ memset(rt_hist->loop_magic, 0, sizeof(rt_hist->loop_magic));
if (!(list_empty(&orig_event->rt_hist_list)))
rt_hist->prev_rt_hist = (struct rt_hist *)(orig_event->rt_hist_list.prev);
@@ -606,8 +607,8 @@
list_for_each_entry(seqno_event, &orig_event->event_list, list) {
if (seqno_event->seqno > seqno)
+ break;
- break;
if (seqno_event->rt_hist)
rt_hist = seqno_event->rt_hist;
}
@@ -696,9 +697,15 @@
{
struct orig_event *orig_event;
struct rt_hist *rt_hist, *rt_hist_tmp;
- char curr_loop_magic[LOOP_MAGIC_LEN];
- int res;
+ char curr_loop_magic[LOOP_MAGIC_LEN], loop_check = 0;
+ int res, seqno_tmp, seqno_min_tmp = seqno_min;
+ /* printf("%i: curr_node: %s ", bla,
+ get_name_by_macstr(curr_node->name, read_opt));
+
+ printf("dst_node: %s [%i - %i]\n",
+ get_name_by_macstr(dst_node->name, read_opt), seqno_min, seqno_max); */
+
/* recursion ends here */
if (curr_node == dst_node) {
rt_hist = get_rt_hist_by_node_seqno(src_node, dst_node, seqno_max);
@@ -712,20 +719,8 @@
memset(curr_loop_magic, 0, LOOP_MAGIC_LEN);
snprintf(curr_loop_magic, LOOP_MAGIC_LEN, "%s%s%i%i",
src_node->name, dst_node->name,
- seqno_min, seqno_rand);
+ seqno_min_tmp, seqno_rand);
- /* we are running in a loop */
- if (memcmp(curr_loop_magic, curr_node->loop_magic2, LOOP_MAGIC_LEN) == 0) {
- rt_hist = get_rt_hist_by_node_seqno(src_node, dst_node, seqno_max);
-
- if (rt_hist)
- print_rt_path_at_seqno(src_node, dst_node, rt_hist->next_hop,
- seqno_max, seqno_rand, read_opt);
- goto out;
- }
-
- memcpy(curr_node->loop_magic2, curr_loop_magic, sizeof(curr_node->loop_magic));
-
orig_event = orig_event_get_by_ptr(curr_node, dst_node);
if (!orig_event)
goto out;
@@ -737,20 +732,36 @@
continue;
}
- if ((seqno_min != -1) && (rt_hist->seqno_event->seqno < seqno_min))
+ if ((seqno_min_tmp != -1) && (rt_hist->seqno_event->seqno < seqno_min_tmp))
continue;
if ((seqno_max != -1) && (rt_hist->seqno_event->seqno >= seqno_max))
continue;
- /* printf("validate route after change (seqno %i) of next hop: %s\n",
+ /* we are running in a loop */
+ if (memcmp(curr_loop_magic, rt_hist->loop_magic, LOOP_MAGIC_LEN) == 0) {
+ rt_hist_tmp = get_rt_hist_by_node_seqno(src_node, dst_node,
+ rt_hist->seqno_event->seqno);
+
+ if (rt_hist_tmp)
+ print_rt_path_at_seqno(src_node, dst_node, rt_hist_tmp->next_hop,
+ rt_hist->seqno_event->seqno, seqno_rand, read_opt);
+ goto loop;
+ }
+
+ memcpy(rt_hist->loop_magic, curr_loop_magic, sizeof(rt_hist->loop_magic));
+ loop_check = 1;
+
+ /* printf("validate route after change (seqno %i) at node: %s\n",
rt_hist->seqno_event->seqno,
- get_name_by_macstr(rt_hist->next_hop->name, read_opt));*/
+ get_name_by_macstr(curr_node->name, read_opt)); */
res = find_rt_table_change(src_node, dst_node, rt_hist->next_hop,
- seqno_min, rt_hist->seqno_event->seqno,
- seqno_rand, read_opt);
+ seqno_min_tmp, rt_hist->seqno_event->seqno,
+ seqno_rand, read_opt);
+ seqno_min_tmp = rt_hist->seqno_event->seqno + 1;
+
/* find_rt_table_change() did not run into a loop and printed the path */
if (res == 0)
continue;
@@ -768,14 +779,42 @@
rt_hist->seqno_event->seqno, seqno_rand, read_opt);
}
- rt_hist = get_rt_hist_by_seqno(orig_event, seqno_max - 1);
+ /**
+ * if we have no routing table changes within the seqno range
+ * the loop detection above won't be triggered
+ **/
+ if (!loop_check) {
+ if (memcmp(curr_loop_magic, curr_node->loop_magic2, LOOP_MAGIC_LEN) == 0) {
+ rt_hist_tmp = get_rt_hist_by_node_seqno(src_node, dst_node, seqno_min);
+ if (rt_hist_tmp)
+ print_rt_path_at_seqno(src_node, dst_node, rt_hist_tmp->next_hop,
+ seqno_min, seqno_rand, read_opt);
+
+ /* no need to print the path twice */
+ if (seqno_min == seqno_max)
+ goto out;
+ else
+ goto loop;
+ }
+
+ memcpy(curr_node->loop_magic2, curr_loop_magic, sizeof(curr_node->loop_magic2));
+ }
+
+ seqno_tmp = seqno_max - 1;
+ if (seqno_min == seqno_max)
+ seqno_tmp = seqno_max;
+
+ rt_hist = get_rt_hist_by_seqno(orig_event, seqno_tmp);
+
if (rt_hist)
return find_rt_table_change(src_node, dst_node, rt_hist->next_hop,
- seqno_min, seqno_max, seqno_rand, read_opt);
+ seqno_min_tmp, seqno_max, seqno_rand, read_opt);
out:
return -1;
+loop:
+ return -2;
}
static void loop_detection(char *loop_orig, int seqno_min, int seqno_max, char *filter_orig, int read_opt)
@@ -784,7 +823,7 @@
struct orig_event *orig_event;
struct hash_it_t *hashit = NULL;
struct rt_hist *rt_hist, *prev_rt_hist;
- int last_seqno = -1, seqno_count = 0;
+ int last_seqno = -1, seqno_count = 0, res;
char check_orig[NAME_LEN];
printf("\nAnalyzing routing tables ");
@@ -880,19 +919,25 @@
goto validate_path;
}
- /*printf("\n=> checking orig %s in seqno range of: %i - %i ",
+ if (rt_hist->seqno_event->seqno == prev_rt_hist->seqno_event->seqno + 1)
+ goto validate_path;
+
+ /* printf("\n=> checking orig %s in seqno range of: %i - %i ",
get_name_by_macstr(rt_hist->seqno_event->orig->name, read_opt),
prev_rt_hist->seqno_event->seqno + 1,
rt_hist->seqno_event->seqno);
printf("(prev nexthop: %s)\n",
- get_name_by_macstr(prev_rt_hist->next_hop->name, read_opt));*/
+ get_name_by_macstr(prev_rt_hist->next_hop->name, read_opt)); */
- find_rt_table_change(bat_node, rt_hist->seqno_event->orig, prev_rt_hist->next_hop,
- prev_rt_hist->seqno_event->seqno + 1, rt_hist->seqno_event->seqno,
- seqno_count, read_opt);
+ res = find_rt_table_change(bat_node, rt_hist->seqno_event->orig,
+ prev_rt_hist->next_hop,
+ prev_rt_hist->seqno_event->seqno + 1,
+ rt_hist->seqno_event->seqno,
+ seqno_count, read_opt);
- continue;
+ if (res != -2)
+ continue;
}
validate_path:
Modified: trunk/batctl/bisect.h
===================================================================
--- trunk/batctl/bisect.h 2009-11-04 23:12:34 UTC (rev 1460)
+++ trunk/batctl/bisect.h 2009-11-04 23:12:40 UTC (rev 1461)
@@ -60,6 +60,7 @@
struct seqno_event *seqno_event;
struct bat_node *next_hop;
char flags;
+ char loop_magic[LOOP_MAGIC_LEN];
};
struct rt_entry {
12 years, 7 months
r1460 - trunk/batman-adv-kernelland
by postmaster@open-mesh.net
Author: marek
Date: 2009-11-04 23:12:34 +0000 (Wed, 04 Nov 2009)
New Revision: 1460
Modified:
trunk/batman-adv-kernelland/routing.c
Log:
[batman-adv] avoid temporary routing loops
Modified: trunk/batman-adv-kernelland/routing.c
===================================================================
--- trunk/batman-adv-kernelland/routing.c 2009-10-26 20:48:30 UTC (rev 1459)
+++ trunk/batman-adv-kernelland/routing.c 2009-11-04 23:12:34 UTC (rev 1460)
@@ -344,18 +344,28 @@
tmp_hna_buff_len = (hna_buff_len > batman_packet->num_hna * ETH_ALEN ? batman_packet->num_hna * ETH_ALEN : hna_buff_len);
- /**
- * if we got have a better tq value via this neighbour or
- * same tq value but the link is more symetric change the next hop
- * router
- */
- if ((orig_node->router != neigh_node) && ((!orig_node->router) ||
- (neigh_node->tq_avg > orig_node->router->tq_avg) ||
- ((neigh_node->tq_avg == orig_node->router->tq_avg) &&
- (neigh_node->orig_node->bcast_own_sum[if_incoming->if_num] > orig_node->router->orig_node->bcast_own_sum[if_incoming->if_num]))))
- update_routes(orig_node, neigh_node, hna_buff, tmp_hna_buff_len);
- else
- update_routes(orig_node, orig_node->router, hna_buff, tmp_hna_buff_len);
+ /* if this neighbor already is our next hop there is nothing to change */
+ if (orig_node->router == neigh_node)
+ goto update_hna;
+
+ /* if this neighbor does not offer a better TQ we won't consider it */
+ if ((orig_node->router) &&
+ (orig_node->router->tq_avg > neigh_node->tq_avg))
+ goto update_hna;
+
+ /* if the TQ is the same and the link not more symetric we won't consider it either */
+ if ((orig_node->router) &&
+ ((neigh_node->tq_avg == orig_node->router->tq_avg) &&
+ (orig_node->router->orig_node->bcast_own_sum[if_incoming->if_num] >
+ neigh_node->orig_node->bcast_own_sum[if_incoming->if_num])))
+ goto update_hna;
+
+ update_routes(orig_node, neigh_node, hna_buff, tmp_hna_buff_len);
+ return;
+
+update_hna:
+ update_routes(orig_node, orig_node->router, hna_buff, tmp_hna_buff_len);
+ return;
}
static char count_real_packets(struct ethhdr *ethhdr, struct batman_packet *batman_packet, struct batman_if *if_incoming)
@@ -402,7 +412,7 @@
/* Silently drop when the batman packet is actually not a correct packet.
*
- * This might happen if a packet is padded (e.g. Ethernet has a
+ * This might happen if a packet is padded (e.g. Ethernet has a
* minimum frame length of 64 byte) and the aggregation interprets
* it as an additional length.
*
@@ -491,6 +501,15 @@
if (orig_node == NULL)
return;
+ /* avoid temporary routing loops */
+ if ((orig_node->router) && (orig_node->router->orig_node->router) &&
+ (compare_orig(orig_node->router->addr, batman_packet->prev_sender)) &&
+ !(compare_orig(batman_packet->orig, batman_packet->prev_sender)) &&
+ (compare_orig(orig_node->router->addr, orig_node->router->orig_node->router->addr))) {
+ debug_log(LOG_TYPE_BATMAN, "Drop packet: ignoring all rebroadcast packets that may make me loop (sender: %s) \n", neigh_str);
+ return;
+ }
+
/* if sender is a direct neighbor the sender mac equals originator mac */
orig_neigh_node = (is_single_hop_neigh ? orig_node : get_orig_node(ethhdr->h_source));
if (orig_neigh_node == NULL)
12 years, 7 months