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);
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
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;
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;
Repository : ssh://git@open-mesh.org/batman-adv
Branch 'next' now includes:
9f1fb69 batman-adv: Fix NULL pointer dereference in DAT hash collision avoidance
054c44a Merge branch 'maint' into next