[openwrt-feed-batman-adv] master: batctl-devel: update to latest master (6a5d74a)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/openwrt-feed-batman-adv
On branch : master
>---------------------------------------------------------------
commit 6a5d74ac0914e9013903d6c208c886b0a00be5ce
Author: Marek Lindner <mareklindner(a)neomailbox.ch>
Date: Wed Jul 22 18:15:27 2015 +0800
batctl-devel: update to latest master
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
6a5d74ac0914e9013903d6c208c886b0a00be5ce
batctl-devel/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/batctl-devel/Makefile b/batctl-devel/Makefile
index 7d61513..05e2d41 100644
--- a/batctl-devel/Makefile
+++ b/batctl-devel/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batctl-devel
-PKG_VERSION:=224b5e4
+PKG_VERSION:=2c2cb26
PKG_BATCTL_SHORTREV:=$(shell echo $(PKG_VERSION) | cut -c1-7)
PKG_BATCTL_FNAME:=batctl-devel-$(PKG_BATCTL_SHORTREV).tar.gz
PKG_BATCTL_DIR:=batctl-$(PKG_BATCTL_SHORTREV)
7 years, 6 months
[batman-adv] master: Merge branch 'next' (e017251)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit e017251099df603ec0857dfe306bed2434d7b487
Merge: 4610f5d 126c2f7
Author: Marek Lindner <mareklindner(a)neomailbox.ch>
Date: Mon Jul 20 13:51:20 2015 +0800
Merge branch 'next'
>---------------------------------------------------------------
e017251099df603ec0857dfe306bed2434d7b487
net/batman-adv/multicast.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
7 years, 6 months
[batman-adv] next: Merge branch 'maint' into next (126c2f7)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
>---------------------------------------------------------------
commit 126c2f7a7c7d75ba85205d3c0756fd6ec0366c93
Merge: 8592db1 7ad001a
Author: Marek Lindner <mareklindner(a)neomailbox.ch>
Date: Mon Jul 20 13:50:46 2015 +0800
Merge branch 'maint' into next
>---------------------------------------------------------------
126c2f7a7c7d75ba85205d3c0756fd6ec0366c93
net/batman-adv/multicast.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
7 years, 6 months
[batman-adv] maint: batman-adv: Avoid crashing kernel with multicast asserts (7ad001a)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : maint
>---------------------------------------------------------------
commit 7ad001a18d1a6e2fd19969fdd671efe99d75920f
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Fri Jul 17 10:03:43 2015 +0200
batman-adv: Avoid crashing kernel with multicast asserts
The BUG_ON added to the multicast code in commit 7f220ed1f063 ("batman-adv:
Fix potential synchronization issues in mcast tvlv handler") will crash the
kernel when the statement is true. This is not strictly required and a
WARN_ON is enough to raise attention.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Acked-by: Linus Lüssing <linus.luessing(a)c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
7ad001a18d1a6e2fd19969fdd671efe99d75920f
multicast.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/multicast.c b/multicast.c
index ee8317f..417c3fa 100644
--- a/multicast.c
+++ b/multicast.c
@@ -582,7 +582,7 @@ static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock);
/* flag checks above + mcast_handler_lock prevents this */
- BUG_ON(!hlist_unhashed(node));
+ WARN_ON(!hlist_unhashed(node));
hlist_add_head_rcu(node, head);
spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
@@ -593,7 +593,7 @@ static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock);
/* flag checks above + mcast_handler_lock prevents this */
- BUG_ON(hlist_unhashed(node));
+ WARN_ON(hlist_unhashed(node));
hlist_del_init_rcu(node);
spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
@@ -625,7 +625,7 @@ static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock);
/* flag checks above + mcast_handler_lock prevents this */
- BUG_ON(!hlist_unhashed(node));
+ WARN_ON(!hlist_unhashed(node));
hlist_add_head_rcu(node, head);
spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
@@ -636,7 +636,7 @@ static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock);
/* flag checks above + mcast_handler_lock prevents this */
- BUG_ON(hlist_unhashed(node));
+ WARN_ON(hlist_unhashed(node));
hlist_del_init_rcu(node);
spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
@@ -668,7 +668,7 @@ static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock);
/* flag checks above + mcast_handler_lock prevents this */
- BUG_ON(!hlist_unhashed(node));
+ WARN_ON(!hlist_unhashed(node));
hlist_add_head_rcu(node, head);
spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
@@ -679,7 +679,7 @@ static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv,
spin_lock_bh(&bat_priv->mcast.want_lists_lock);
/* flag checks above + mcast_handler_lock prevents this */
- BUG_ON(hlist_unhashed(node));
+ WARN_ON(hlist_unhashed(node));
hlist_del_init_rcu(node);
spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
7 years, 6 months
[linux-merge]linux integration; annotated tag, v4.2-rc3, created. v4.2-rc3
by postmaster@open-mesh.org
The annotated tag, v4.2-rc3 has been created
at a0ff0d2281af2d44f49e2b8f05199778c152a6a4 (tag)
tagging 52721d9d3334c1cb1f76219a161084094ec634dc (commit)
replaces v4.2-rc2
tagged by Linus Torvalds
on Sun Jul 19 14:45:24 2015 -0700
- Shortlog ------------------------------------------------------------
Linux 4.2-rc3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAABAgAGBQJVrBp0AAoJEHm+PkMAQRiGADsH/iCVjA1x+a19xpeuHNJcjcQR
Lin8td8zdUxereBNQOFjnkhCmKtzLODXGkQdYFaWZx8mbEQ93wC+nPV8O+LsqPbI
T/2MjJ78IjlNsoTyE4b1AhqpASsxrLZJNB+f9dd251f1BSAzKfRER0G46WxbOPN7
9HdzCMbtx03ZJkr9baE6alljxA43O5mpDzpotKIagfTMQr5h0ra16uXlmVXFjHRs
roNJsugwKxJPnVmLWWOM1JsAjRSMBAXQUQxhJJCMDOhgZZ5KR1z6L30ESeFTUhvh
WG/2MEfyVYXn91kV0N+AUCuOFHTv6uiaz3RaRVJFDSv3sPOh1WQ9tQHxyrBsqyY=
=MA/P
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
7 years, 6 months
[batctl] master: batctl: list supported and configured routing algorithms (2c2cb26)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 2c2cb260ad2e089d453eed27a89ae9af16facda2
Author: Marek Lindner <mareklindner(a)neomailbox.ch>
Date: Fri Jul 17 22:50:03 2015 +0800
batctl: list supported and configured routing algorithms
With this patch, batctl is able to:
* list supported routing algorithms
* list batX interfaces with their configured routing algorithm
* view and alter the selected routing algorithm
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
2c2cb260ad2e089d453eed27a89ae9af16facda2
debug.c | 14 +++++++++
debug.h | 2 ++
main.c | 5 ++++
man/batctl.8 | 8 +++++-
sys.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sys.h | 3 ++
6 files changed, 122 insertions(+), 1 deletion(-)
diff --git a/debug.c b/debug.c
index a050345..c3959db 100644
--- a/debug.c
+++ b/debug.c
@@ -219,6 +219,20 @@ int handle_debug_table(char *mesh_iface, int debug_table, int argc, char **argv)
batctl_debug_tables[debug_table].header_lines);
}
+int print_routing_algos(void) {
+ char full_path[MAX_PATH+1];
+ char *debugfs_mnt;
+
+ debugfs_mnt = debugfs_mount(NULL);
+ if (!debugfs_mnt) {
+ fprintf(stderr, "Error - can't mount or find debugfs\n");
+ return -1;
+ }
+
+ debugfs_make_path(DEBUG_BATIF_PATH_FMT, "", full_path, sizeof(full_path));
+ return read_file(full_path, DEBUG_ROUTING_ALGOS, 0, 0, 0, 0);
+}
+
int print_vis_info(char *mesh_iface)
{
char full_path[MAX_PATH+1];
diff --git a/debug.h b/debug.h
index 2bc0ff9..8287b54 100644
--- a/debug.h
+++ b/debug.h
@@ -28,6 +28,7 @@
#define DEBUG_BATIF_PATH_FMT "%s/batman_adv/%s"
#define DEBUG_TRANSTABLE_GLOBAL "transtable_global"
#define DEBUG_LOG "log"
+#define DEBUG_ROUTING_ALGOS "routing_algos"
enum batctl_debug_tables {
BATCTL_TABLE_ORIGINATORS,
@@ -52,6 +53,7 @@ extern const struct debug_table_data batctl_debug_tables[BATCTL_TABLE_NUM];
int handle_debug_table(char *mesh_iface, int debug_table, int argc, char **argv);
int log_print(char *mesh_iface, int argc, char **argv);
+int print_routing_algos(void);
int print_vis_info(char *mesh_iface);
#endif
diff --git a/main.c b/main.c
index d127cdc..96aea4d 100644
--- a/main.c
+++ b/main.c
@@ -70,6 +70,7 @@ static void print_usage(void)
fprintf(stderr, " \tloglevel|ll [level] \tdisplay or modify the log level\n");
fprintf(stderr, " \tlog|l \tread the log produced by the kernel module\n");
fprintf(stderr, " \tgw_mode|gw [mode] \tdisplay or modify the gateway mode\n");
+ fprintf(stderr, " \trouting_algo|ra [mode] \tdisplay or modify the routing algorithm\n");
fprintf(stderr, "\n");
fprintf(stderr, "debug tables: \tdisplay the corresponding debug table\n");
@@ -150,6 +151,10 @@ int main(int argc, char **argv)
ret = bisect_iv(argc - 1, argv + 1);
#endif
+ } else if ((strcmp(argv[1], "routing_algo") == 0) || (strcmp(argv[1], "ra") == 0)) {
+
+ ret = handle_ra_setting(argc - 1, argv + 1);
+
} else if (check_mesh_iface(mesh_iface) < 0) {
fprintf(stderr, "Error - interface %s is not present or not a batman-adv interface\n", mesh_iface);
exit(EXIT_FAILURE);
diff --git a/man/batctl.8 b/man/batctl.8
index bc190c0..d1acd44 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
-.TH "BATCTL" "8" "Jan 06, 2013" "Linux" "B.A.T.M.A.N. Advanced Control Tool"
+.TH "BATCTL" "8" "July 17, 2015" "Linux" "B.A.T.M.A.N. Advanced Control Tool"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -155,6 +155,12 @@ least XX TQ better than the currently selected gateway (XX has to be a number be
.RE
.RE
.br
+.IP "\fBrouting_algo\fP|\fBra\fP [\fBalgorithm\fP]\fP"
+If no parameter is given the current routing algorithm configuration as well as
+supported routing algorithms are displayed.
+Otherwise the parameter is used to select the routing algorithm for the following
+batX interface to be created.
+.br
.IP "\fBisolation_mark\fP|\fBmark\fP"
If no parameter is given the current isolation mark value is displayed.
Otherwise the parameter is used to set or unset the isolation mark used by the
diff --git a/sys.c b/sys.c
index 81b8faf..838fcd8 100644
--- a/sys.c
+++ b/sys.c
@@ -30,6 +30,7 @@
#include "main.h"
#include "sys.h"
#include "functions.h"
+#include "debug.h"
#define PATH_BUFF_LEN 200
@@ -563,6 +564,96 @@ out:
return res;
}
+static void ra_mode_usage(void)
+{
+ fprintf(stderr, "Usage: batctl [options] routing_algo [algorithm]\n");
+ fprintf(stderr, "options:\n");
+ fprintf(stderr, " \t -h print this help\n");
+}
+
+int handle_ra_setting(int argc, char **argv)
+{
+ DIR *iface_base_dir;
+ struct dirent *iface_dir;
+ int optchar;
+ char *path_buff;
+ int res = EXIT_FAILURE;
+ int first_iface = 1;
+
+ while ((optchar = getopt(argc, argv, "h")) != -1) {
+ switch (optchar) {
+ case 'h':
+ ra_mode_usage();
+ return EXIT_SUCCESS;
+ default:
+ ra_mode_usage();
+ return EXIT_FAILURE;
+ }
+ }
+
+ if (argc == 2) {
+ res = write_file(SYS_SELECTED_RA_PATH, "", argv[1], NULL);
+ goto out;
+ }
+
+ path_buff = malloc(PATH_BUFF_LEN);
+ if (!path_buff) {
+ fprintf(stderr, "Error - could not allocate path buffer: out of memory ?\n");
+ goto out;
+ }
+
+ iface_base_dir = opendir(SYS_IFACE_PATH);
+ if (!iface_base_dir) {
+ fprintf(stderr, "Error - the directory '%s' could not be read: %s\n",
+ SYS_IFACE_PATH, strerror(errno));
+ fprintf(stderr, "Is the batman-adv module loaded and sysfs mounted ?\n");
+ goto free_buff;
+ }
+
+ while ((iface_dir = readdir(iface_base_dir)) != NULL) {
+ snprintf(path_buff, PATH_BUFF_LEN, SYS_ROUTING_ALGO_FMT, iface_dir->d_name);
+ res = read_file("", path_buff, USE_READ_BUFF | SILENCE_ERRORS, 0, 0, 0);
+ if (res != EXIT_SUCCESS)
+ continue;
+
+ if (line_ptr[strlen(line_ptr) - 1] == '\n')
+ line_ptr[strlen(line_ptr) - 1] = '\0';
+
+ if (first_iface) {
+ first_iface = 0;
+ printf("Active routing protocol configuration:\n");
+ }
+
+ printf(" * %s: %s\n", iface_dir->d_name, line_ptr);
+
+ free(line_ptr);
+ line_ptr = NULL;
+ }
+
+ closedir(iface_base_dir);
+ free(path_buff);
+
+ if (!first_iface)
+ printf("\n");
+
+ res = read_file("", SYS_SELECTED_RA_PATH, USE_READ_BUFF, 0, 0, 0);
+ if (res != EXIT_SUCCESS)
+ return EXIT_FAILURE;
+
+ printf("Selected routing algorithm (used when next batX interface is created):\n");
+ printf(" => %s\n", line_ptr);
+ free(line_ptr);
+ line_ptr = NULL;
+
+ print_routing_algos();
+ return EXIT_SUCCESS;
+
+free_buff:
+ free(path_buff);
+out:
+ return res;
+}
+
int check_mesh_iface(char *mesh_iface)
{
char *base_dev = NULL;
diff --git a/sys.h b/sys.h
index 9addd90..13c164e 100644
--- a/sys.h
+++ b/sys.h
@@ -35,6 +35,8 @@
#define SYS_MESH_IFACE_FMT SYS_IFACE_PATH"/%s/batman_adv/mesh_iface"
#define SYS_IFACE_STATUS_FMT SYS_IFACE_PATH"/%s/batman_adv/iface_status"
#define SYS_VLAN_PATH SYS_IFACE_PATH"/%s/mesh/vlan%d/"
+#define SYS_ROUTING_ALGO_FMT SYS_IFACE_PATH"/%s/mesh/routing_algo"
+#define SYS_SELECTED_RA_PATH "/sys/module/batman_adv/parameters/routing_algo"
#define VLAN_ID_MAX_LEN 4
enum batctl_settings_list {
@@ -72,6 +74,7 @@ int interface(char *mesh_iface, int argc, char **argv);
int handle_loglevel(char *mesh_iface, int argc, char **argv);
int handle_sys_setting(char *mesh_iface, int setting, int argc, char **argv);
int handle_gw_setting(char *mesh_iface, int argc, char **argv);
+int handle_ra_setting(int argc, char **argv);
int check_mesh_iface(char *mesh_iface);
int check_mesh_iface_ownership(char *mesh_iface, char *hard_iface);
7 years, 6 months
[batman-adv] master: batman-adv: beautify supported routing algorithm list (4610f5d)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 4610f5dab5690a4bb20809eddb0f210ca2e2a625
Author: Marek Lindner <mareklindner(a)neomailbox.ch>
Date: Fri Jul 17 22:25:59 2015 +0800
batman-adv: beautify supported routing algorithm list
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
4610f5dab5690a4bb20809eddb0f210ca2e2a625
net/batman-adv/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 50fc07b..e61c5f3 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -584,7 +584,7 @@ int batadv_algo_seq_print_text(struct seq_file *seq, void *offset)
seq_puts(seq, "Available routing algorithms:\n");
hlist_for_each_entry(bat_algo_ops, &batadv_algo_list, list) {
- seq_printf(seq, "%s\n", bat_algo_ops->name);
+ seq_printf(seq, " * %s\n", bat_algo_ops->name);
}
return 0;
7 years, 6 months
[batman-adv] master: batman-adv: Fix conditional statements indentation (a25feff)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit a25feff783426cf489eec36840eb3dd0ca749a7a
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Fri Jul 17 10:03:42 2015 +0200
batman-adv: Fix conditional statements indentation
commit 29b9256e6631 ("batman-adv: consider outgoing interface in OGM
sending") incorrectly indented the interface check code.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
a25feff783426cf489eec36840eb3dd0ca749a7a
net/batman-adv/bat_iv_ogm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index df54118..5c12200 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -968,7 +968,7 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface)
rcu_read_lock();
list_for_each_entry_rcu(tmp_hard_iface, &batadv_hardif_list, list) {
if (tmp_hard_iface->soft_iface != hard_iface->soft_iface)
- continue;
+ continue;
batadv_iv_ogm_queue_add(bat_priv, *ogm_buff,
*ogm_buff_len, hard_iface,
tmp_hard_iface, 1, send_time);
7 years, 6 months