[batman-adv] master: batman-adv: free an hard-interface before adding it (5e57e3b)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 5e57e3bff429cd403f0e30af69cf87a2cd55598f
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sat Feb 16 14:42:39 2013 +0100
batman-adv: free an hard-interface before adding it
When adding a new hard interface (e.h. wlan0) to a soft interface (e.g. bat0)
and the former is already enslaved in another virtual interface (e.g. a software
bridge) batman-adv has to free the it first and then continue with the
adding mechanism.
In this way the behaviour becomes consistent with what "ip link set master"
does. At the moment batman-adv enslaves the hard interface without checking for
the master device, possibly causing strange behaviours which are never wanted by
the users.
Reported-by: Marek Lindner <lindner_marek(a)yahoo.de>
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
5e57e3bff429cd403f0e30af69cf87a2cd55598f
compat.h | 5 +++++
hard-interface.c | 14 ++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/compat.h b/compat.h
index 23ced4a..64244ac 100644
--- a/compat.h
+++ b/compat.h
@@ -235,6 +235,11 @@ static int __batadv_interface_set_mac_addr(x, y)
#define netdev_master_upper_dev_link netdev_set_master
#define netdev_upper_dev_unlink(slave, master) netdev_set_master(slave, NULL)
+#define netdev_master_upper_dev_get(dev) \
+({\
+ ASSERT_RTNL();\
+ dev->master;\
+})
#endif /* < KERNEL_VERSION(3, 9, 0) */
diff --git a/hard-interface.c b/hard-interface.c
index c08e39e..fd99e42 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -311,7 +311,7 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
const char *iface_name)
{
struct batadv_priv *bat_priv;
- struct net_device *soft_iface;
+ struct net_device *soft_iface, *master;
__be16 ethertype = __constant_htons(ETH_P_BATMAN);
int ret;
@@ -321,11 +321,6 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
if (!atomic_inc_not_zero(&hard_iface->refcount))
goto out;
- /* hard-interface is part of a bridge */
- if (hard_iface->net_dev->priv_flags & IFF_BRIDGE_PORT)
- pr_err("You are about to enable batman-adv on '%s' which already is part of a bridge. Unless you know exactly what you are doing this is probably wrong and won't work the way you think it would.\n",
- hard_iface->net_dev->name);
-
soft_iface = dev_get_by_name(&init_net, iface_name);
if (!soft_iface) {
@@ -347,6 +342,13 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
goto err_dev;
}
+ /* check if the interface is enslaved in another virtual one and
+ * in that case unlink it first
+ */
+ master = netdev_master_upper_dev_get(hard_iface->net_dev);
+ if (master)
+ netdev_upper_dev_unlink(hard_iface->net_dev, master);
+
hard_iface->soft_iface = soft_iface;
bat_priv = netdev_priv(hard_iface->soft_iface);
9 years, 11 months
[batman-adv] master: batman-adv: add compat support for the new netlink ops (988f5b2)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 988f5b2d1a660636633e477c20ec24f6e471731e
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Wed Feb 20 15:57:31 2013 +0100
batman-adv: add compat support for the new netlink ops
This patches enable the new rtnl ops to compile on kernels starting from 2.6.32
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
Tested-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
>---------------------------------------------------------------
988f5b2d1a660636633e477c20ec24f6e471731e
compat.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/compat.h b/compat.h
index 425b3d9..23ced4a 100644
--- a/compat.h
+++ b/compat.h
@@ -71,6 +71,9 @@ static inline void batadv_this_cpu_add(uint64_t *count_ptr, size_t count)
put_cpu();
}
+#define batadv_softif_destroy_netlink(dev, head) batadv_softif_destroy_netlink(dev)
+#define unregister_netdevice_queue(dev, head) unregister_netdevice(dev)
+
#endif /* < KERNEL_VERSION(2, 6, 33) */
@@ -132,6 +135,24 @@ static inline int batadv_param_set_copystring(const char *val,
#define kstrtoul strict_strtoul
#define kstrtol strict_strtol
+#define batadv_softif_slave_add(x, y) \
+batadv_softif_slave_add(struct net_device *dev, struct ifreq *rq, int cmd)\
+{\
+ return -EOPNOTSUPP;\
+}\
+static int __attribute__((unused)) __batadv_softif_slave_add(x, y)
+
+#define batadv_softif_slave_del(x, y) \
+__batadv_softif_slave_del(struct net_device *dev, struct net_device *slave_dev);\
+static int batadv_softif_slave_del(struct net_device *dev, struct ifreq *rq, int cmd)\
+{\
+ return -EOPNOTSUPP;\
+}\
+static int __attribute__((unused)) __batadv_softif_slave_del(x, y)
+
+#define ndo_add_slave ndo_do_ioctl
+#define ndo_del_slave ndo_do_ioctl
+
#endif /* < KERNEL_VERSION(2, 6, 39) */
9 years, 11 months
[alfred] master: alfred: handle sigpipe (27aee52)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/alfred
On branch : master
>---------------------------------------------------------------
commit 27aee5246d49ea2d08565a35fdc2e59f3ab7b5df
Author: Simon Wunderlich <simon(a)open-mesh.com>
Date: Thu Feb 21 11:21:50 2013 +0100
alfred: handle sigpipe
Otherwise alfred might exit when a SIGPIPE occurs, e.g. when writing
to a client which has already closed his side of the socket.
Reported-by: Antonio Quartulli <antonio(a)open-mesh.com>
Signed-off-by: Simon Wunderlich <simon(a)open-mesh.com>
>---------------------------------------------------------------
27aee5246d49ea2d08565a35fdc2e59f3ab7b5df
main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/main.c b/main.c
index c3bef57..86acfb7 100644
--- a/main.c
+++ b/main.c
@@ -28,6 +28,7 @@
#include <arpa/inet.h>
#include <sys/select.h>
#include <sys/time.h>
+#include <signal.h>
#include "alfred.h"
static void alfred_usage(void)
@@ -132,6 +133,9 @@ static struct globals *alfred_init(int argc, char *argv[])
return NULL;
}
}
+
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ fprintf(stderr, "could not register SIGPIPE handler\n");
return globals;
}
9 years, 11 months
[linux-merge]linux integration; annotated tag, v3.8, created. v3.8
by postmaster@open-mesh.org
The annotated tag, v3.8 has been created
at a788f85fbb206352319787d9dc1a5e62d87f74d4 (tag)
tagging 19f949f52599ba7c3f67a5897ac6be14bfcb1200 (commit)
replaces v3.8-rc7
tagged by Linus Torvalds
on Mon Feb 18 15:59:05 2013 -0800
- Shortlog ------------------------------------------------------------
Linux 3.8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQEcBAABAgAGBQJRIsBOAAoJEHm+PkMAQRiGqq8IAKQvtCu/V3jVpEHDg6CwvKkT
0gNjWyBO1gKyYwxTOLy9mtzu+4dgeGqhg5KdTPi4GIqWLHqjw3cSk+MbEqh64cz4
WXSYvKL5EUDdbU8GCn/UIGgUA/9Yc3ORN8NuF3yMoqqY2oqvoYdxdL5LRu2tKcUV
JzgziX1MCxKyOQG8XXgiMaJJapIO43YvkOE1hwMVQHAlew2lX8ki7oUXk52CGAs6
TFXDVqWRZibsP5mA4BPtXyA7YGJDqTXrmtnHygmz2lrxn5yLICkQ8qC2KjQBHbbP
N62dz2bj042WF60yj3BE5PlkG/vzf34BDKd9C+nZrw7Y0PgIVQElemvWoV6vwmE=
=7k5r
-----END PGP SIGNATURE-----
Pau Koning (1):
batman-adv: Fix NULL pointer dereference in DAT hash collision avoidance
-----------------------------------------------------------------------
--
linux integration
9 years, 11 months
[alfred] master: alfred: in recv_alfred_packet() add break at the end of the case block (274133d)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/alfred
On branch : master
>---------------------------------------------------------------
commit 274133de799a15f9a44f5a919cad8038c57c95aa
Author: Antonio Quartulli <antonio(a)open-mesh.com>
Date: Tue Feb 19 15:36:46 2013 +0100
alfred: in recv_alfred_packet() add break at the end of the case block
In recv_alfred_packet() a "break" statement is missing at the end of a case
block and the function is returning -1 instead of 0 even if the packet type was
known. Add a break to let the function behave correctly.
However this bug is harmless at the moment because the return value of the
function is not checked anywhere.
Signed-off-by: Antonio Quartulli <antonio(a)open-mesh.com>
Signed-off-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
>---------------------------------------------------------------
274133de799a15f9a44f5a919cad8038c57c95aa
recv.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/recv.c b/recv.c
index 0170695..ffabba5 100644
--- a/recv.c
+++ b/recv.c
@@ -416,6 +416,7 @@ int recv_alfred_packet(struct globals *globals)
case ALFRED_STATUS_TXEND:
process_alfred_status_txend(globals, &source.sin6_addr,
(struct alfred_status_v0 *)packet);
+ break;
default:
/* unknown packet type */
return -1;
9 years, 11 months
[batman-adv] master: batman-adv: make batadv_softif_destroy_netlink() static (17d1d49)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 17d1d49db3f5b975ad506fb90bd2f88874e8a542
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sat Feb 16 13:50:52 2013 +0100
batman-adv: make batadv_softif_destroy_netlink() static
batadv_softif_destroy_netlink() is used in the file where it is defined only,
therefore it must be static.
Introduced by 5317331775c3168b8155b03ec89b1c4c508b9043 ("batman-adv: Allow to
use rntl_link for device creation/deletion")
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
17d1d49db3f5b975ad506fb90bd2f88874e8a542
soft-interface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/soft-interface.c b/soft-interface.c
index 39caefa..403b8c4 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -653,8 +653,8 @@ void batadv_softif_destroy_sysfs(struct net_device *soft_iface)
* @soft_iface: the to-be-removed batman-adv interface
* @head: list pointer
*/
-void batadv_softif_destroy_netlink(struct net_device *soft_iface,
- struct list_head *head)
+static void batadv_softif_destroy_netlink(struct net_device *soft_iface,
+ struct list_head *head)
{
struct batadv_hard_iface *hard_iface;
9 years, 11 months
[openwrt-feed-batman-adv] master: batman-adv-devel: network coding support and batman-adv script removal (72ac838)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/openwrt-feed-batman-adv
On branch : master
>---------------------------------------------------------------
commit 72ac838ba53467b1ff178d124422f8917815a252
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Sat Feb 16 19:46:51 2013 +0800
batman-adv-devel: network coding support and batman-adv script removal
With the netifd integration the batman-adv script broke. This script
can safely be removed because '/etc/init.d/network' reloads the
batman-adv interfaces as well (thanks to netifd).
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
72ac838ba53467b1ff178d124422f8917815a252
batman-adv-devel/Config.in | 9 +++-
batman-adv-devel/Makefile | 1 +
batman-adv-devel/files/etc/config/batman-adv | 1 +
batman-adv-devel/files/lib/batman-adv/config.sh | 10 ++--
batman-adv-devel/files/usr/sbin/batman-adv | 60 -----------------------
5 files changed, 15 insertions(+), 66 deletions(-)
diff --git a/batman-adv-devel/Config.in b/batman-adv-devel/Config.in
index c3a7162..154cde8 100644
--- a/batman-adv-devel/Config.in
+++ b/batman-adv-devel/Config.in
@@ -14,6 +14,11 @@ config KMOD_BATMAN_ADV_DEVEL_DAT
depends PACKAGE_kmod-batman-adv-devel
default y
+config KMOD_BATMAN_ADV_DEVEL_NC
+ bool "enable network coding [requires promisc mode support]"
+ depends PACKAGE_kmod-batman-adv-devel
+ default n
+
config KMOD_BATMAN_ADV_DEVEL_BATCTL
bool "enable batctl"
depends PACKAGE_kmod-batman-adv-devel
@@ -27,7 +32,7 @@ config KMOD_BATMAN_ADV_DEVEL_BATMAN_REV
string
prompt "batman-adv git revision to build package with"
depends PACKAGE_kmod-batman-adv-devel
- default "a33c882"
+ default "edd0853"
help
Enter the full or shortened git revision to override package
default value. This allows to build from non-master branches
@@ -37,7 +42,7 @@ config KMOD_BATMAN_ADV_DEVEL_BATCTL_REV
string
prompt "batctl git revision to build package with"
depends PACKAGE_kmod-batman-adv-devel
- default "0e2efdc"
+ default "3921283"
help
Enter the full or shortened git revision to override package
default value. This allows to build from non-master branches
diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile
index 7bbb75e..513a793 100644
--- a/batman-adv-devel/Makefile
+++ b/batman-adv-devel/Makefile
@@ -61,6 +61,7 @@ MAKE_BATMAN_ADV_ARGS += \
CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_DEBUG_LOG),y,n) \
CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_BLA),y,n) \
CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_DAT),y,n) \
+ CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_NC),y,n) \
REVISION="$(PKG_BATMAN_SHORTREV)" all
MAKE_BATCTL_ARGS += \
diff --git a/batman-adv-devel/files/etc/config/batman-adv b/batman-adv-devel/files/etc/config/batman-adv
index 6a62203..79d660d 100644
--- a/batman-adv-devel/files/etc/config/batman-adv
+++ b/batman-adv-devel/files/etc/config/batman-adv
@@ -12,6 +12,7 @@ config 'mesh' 'bat0'
option 'vis_mode'
option 'bridge_loop_avoidance'
option 'distributed_arp_table'
+ option 'network_coding'
option 'hop_penalty'
# yet another batX instance
diff --git a/batman-adv-devel/files/lib/batman-adv/config.sh b/batman-adv-devel/files/lib/batman-adv/config.sh
index ae102e9..471c1f2 100644
--- a/batman-adv-devel/files/lib/batman-adv/config.sh
+++ b/batman-adv-devel/files/lib/batman-adv/config.sh
@@ -5,14 +5,14 @@ bat_load_module()
[ -d "/sys/module/batman_adv/" ] && return
. /lib/functions.sh
- load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-batman-adv*
+ load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-crypto* /etc/modules.d/*-lib-crc* /etc/modules.d/*-batman-adv*
}
bat_config()
{
local mesh="$1"
local aggregated_ogms ap_isolation bonding bridge_loop_avoidance distributed_arp_table fragmentation
- local gw_bandwidth gw_mode gw_sel_class hop_penalty log_level orig_interval vis_mode
+ local gw_bandwidth gw_mode gw_sel_class hop_penalty network_coding log_level orig_interval vis_mode
config_get aggregated_ogms "$mesh" aggregated_ogms
config_get ap_isolation "$mesh" ap_isolation
@@ -24,6 +24,7 @@ bat_config()
config_get gw_mode "$mesh" gw_mode
config_get gw_sel_class "$mesh" gw_sel_class
config_get hop_penalty "$mesh" hop_penalty
+ config_get network_coding "$mesh" network_coding
config_get log_level "$mesh" log_level
config_get orig_interval "$mesh" orig_interval
config_get vis_mode "$mesh" vis_mode
@@ -33,13 +34,14 @@ bat_config()
[ -n "$aggregate_ogms" ] && echo $aggregate_ogms > /sys/class/net/$mesh/mesh/aggregate_ogms
[ -n "$ap_isolation" ] && echo $ap_isolation > /sys/class/net/$mesh/mesh/ap_isolation
[ -n "$bonding" ] && echo $bonding > /sys/class/net/$mesh/mesh/bonding
- [ -n "$bridge_loop_avoidance" ] && echo $bridge_loop_avoidance > /sys/class/net/$mesh/mesh/bridge_loop_avoidance
- [ -n "$distributed_arp_table" ] && echo $distributed_arp_table > /sys/class/net/$mesh/mesh/distributed_arp_table
+ [ -n "$bridge_loop_avoidance" ] && echo $bridge_loop_avoidance > /sys/class/net/$mesh/mesh/bridge_loop_avoidance 2>&-
+ [ -n "$distributed_arp_table" ] && echo $distributed_arp_table > /sys/class/net/$mesh/mesh/distributed_arp_table 2>&-
[ -n "$fragmentation" ] && echo $fragmentation > /sys/class/net/$mesh/mesh/fragmentation
[ -n "$gw_bandwidth" ] && echo $gw_bandwidth > /sys/class/net/$mesh/mesh/gw_bandwidth
[ -n "$gw_mode" ] && echo $gw_mode > /sys/class/net/$mesh/mesh/gw_mode
[ -n "$gw_sel_class" ] && echo $gw_sel_class > /sys/class/net/$mesh/mesh/gw_sel_class
[ -n "$hop_penalty" ] && echo $hop_penalty > /sys/class/net/$mesh/mesh/hop_penalty
+ [ -n "$network_coding" ] && echo $network_coding > /sys/class/net/$mesh/mesh/network_coding 2>&-
[ -n "$log_level" ] && echo $log_level > /sys/class/net/$mesh/mesh/log_level 2>&-
[ -n "$orig_interval" ] && echo $orig_interval > /sys/class/net/$mesh/mesh/orig_interval
[ -n "$vis_mode" ] && echo $vis_mode > /sys/class/net/$mesh/mesh/vis_mode
diff --git a/batman-adv-devel/files/usr/sbin/batman-adv b/batman-adv-devel/files/usr/sbin/batman-adv
deleted file mode 100644
index ca9e603..0000000
--- a/batman-adv-devel/files/usr/sbin/batman-adv
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2011 OpenWrt.org
-
-. /lib/functions.sh
-. /lib/batman-adv/config.sh
-
-start_mesh() {
- local mesh="$1"
- local ifaces=$(awk -F':' '{if (NR > 2) print $1}' /proc/net/dev)
-
- for iface in $ifaces; do
- [ -d /sys/class/net/$iface/batman_adv/ ] && bat_add_interface "$mesh" "$iface"
- done
-
- bat_config "$mesh"
-}
-
-stop_mesh() {
- local mesh="$1"
- local ifaces=$(awk -F':' '{if (NR > 2) print $1}' /proc/net/dev)
-
- for iface in $ifaces; do
- [ -d /sys/class/net/$iface/batman_adv/ ] && bat_del_interface "$mesh" "$iface"
- done
-}
-
-# can also be used with "batman-adv start bat0"
-start() {
- bat_load_module
- config_load batman-adv
-
- if [ -n "$1" ]; then
- start_mesh $1
- else
- config_foreach start_mesh mesh
- fi
-}
-
-# can also be used with "batman-adv stop bat0"
-stop () {
- config_load batman-adv
-
- if [ -n "$1" ]; then
- stop_mesh $1
- else
- config_foreach stop_mesh mesh
- fi
-}
-
-restart() {
- stop $1
- start $1
-}
-
-case "$1" in
- start) start $2 ;;
- stop) stop $2 ;;
- restart) restart $2 ;;
- *) echo "Usage: batman-adv <start|stop|restart> [mesh instance]"
-esac
9 years, 11 months
[batman-adv] master: Merge branch 'next' (5ac557a)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 5ac557ac6243cd005a2e1c1904dbb1ead4d0d705
Merge: edd0853 054c44a
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Sat Feb 16 18:52:43 2013 +0800
Merge branch 'next'
>---------------------------------------------------------------
5ac557ac6243cd005a2e1c1904dbb1ead4d0d705
distributed-arp-table.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
9 years, 11 months