summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/distributed-arp-table.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-08-17 14:31:42 -0700
committerDavid S. Miller <davem@davemloft.net>2015-08-17 14:31:42 -0700
commitc1f066d4ee0bde4bb0ff4ac295218b631729e0de (patch)
treee33985e92b07c879a2759f20518887ad8e5af12b /net/batman-adv/distributed-arp-table.c
parent2bd736fa0d8a1da90e6ccaa6a79e56a8d2ae60c4 (diff)
parent53cf037bf846417fd92dc92ddf97267f69b110f4 (diff)
downloadop-kernel-dev-c1f066d4ee0bde4bb0ff4ac295218b631729e0de.zip
op-kernel-dev-c1f066d4ee0bde4bb0ff4ac295218b631729e0de.tar.gz
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Antonio Quartulli says: ==================== Included changes: - avoid integer overflow in GW selection routine - prevent race condition by making capability bit changes atomic (use clear/set/test_bit) - fix synchronization issue in mcast tvlv handler - fix crash on double list removal of TT Request objects - fix leak by puring packets enqueued for sending upon iface removal - ensure network header pointer is set in skb ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv/distributed-arp-table.c')
-rw-r--r--net/batman-adv/distributed-arp-table.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 6d0b471..cc7d87d 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -19,6 +19,7 @@
#include "main.h"
#include <linux/atomic.h>
+#include <linux/bitops.h>
#include <linux/byteorder/generic.h>
#include <linux/errno.h>
#include <linux/etherdevice.h>
@@ -453,7 +454,7 @@ static bool batadv_is_orig_node_eligible(struct batadv_dat_candidate *res,
int j;
/* check if orig node candidate is running DAT */
- if (!(candidate->capabilities & BATADV_ORIG_CAPA_HAS_DAT))
+ if (!test_bit(BATADV_ORIG_CAPA_HAS_DAT, &candidate->capabilities))
goto out;
/* Check if this node has already been selected... */
@@ -713,9 +714,9 @@ static void batadv_dat_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
uint16_t tvlv_value_len)
{
if (flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND)
- orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_DAT;
+ clear_bit(BATADV_ORIG_CAPA_HAS_DAT, &orig->capabilities);
else
- orig->capabilities |= BATADV_ORIG_CAPA_HAS_DAT;
+ set_bit(BATADV_ORIG_CAPA_HAS_DAT, &orig->capabilities);
}
/**
OpenPOWER on IntegriCloud