aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-09-28 14:40:49 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-28 14:40:49 -0400
commit6a06e5e1bb217be077e1f8ee2745b4c5b1aa02db (patch)
tree8faea23112a11f52524eb413f71b7b02712d8b53 /net/batman-adv
parentd9f72f359e00a45a6cd7cc2d5121b04b9dc927e1 (diff)
parent6672d90fe779dc0dfffe027c3ede12609df091c2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/team/team.c drivers/net/usb/qmi_wwan.c net/batman-adv/bat_iv_ogm.c net/ipv4/fib_frontend.c net/ipv4/route.c net/l2tp/l2tp_netlink.c The team, fib_frontend, route, and l2tp_netlink conflicts were simply overlapping changes. qmi_wwan and bat_iv_ogm were of the "use HEAD" variety. With help from Antonio Quartulli. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/bat_iv_ogm.c7
-rw-r--r--net/batman-adv/bitarray.h6
-rw-r--r--net/batman-adv/soft-interface.c7
3 files changed, 13 insertions, 7 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index df79300dcb7b..b02b75dae3a8 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -652,6 +652,7 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
652 struct batadv_neigh_node *router = NULL; 652 struct batadv_neigh_node *router = NULL;
653 struct batadv_orig_node *orig_node_tmp; 653 struct batadv_orig_node *orig_node_tmp;
654 struct hlist_node *node; 654 struct hlist_node *node;
655 int if_num;
655 uint8_t sum_orig, sum_neigh; 656 uint8_t sum_orig, sum_neigh;
656 uint8_t *neigh_addr; 657 uint8_t *neigh_addr;
657 uint8_t tq_avg; 658 uint8_t tq_avg;
@@ -738,12 +739,14 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
738 if (router && (neigh_node->tq_avg == router->tq_avg)) { 739 if (router && (neigh_node->tq_avg == router->tq_avg)) {
739 orig_node_tmp = router->orig_node; 740 orig_node_tmp = router->orig_node;
740 spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); 741 spin_lock_bh(&orig_node_tmp->ogm_cnt_lock);
741 sum_orig = orig_node_tmp->bcast_own_sum[if_incoming->if_num]; 742 if_num = router->if_incoming->if_num;
743 sum_orig = orig_node_tmp->bcast_own_sum[if_num];
742 spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); 744 spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock);
743 745
744 orig_node_tmp = neigh_node->orig_node; 746 orig_node_tmp = neigh_node->orig_node;
745 spin_lock_bh(&orig_node_tmp->ogm_cnt_lock); 747 spin_lock_bh(&orig_node_tmp->ogm_cnt_lock);
746 sum_neigh = orig_node_tmp->bcast_own_sum[if_incoming->if_num]; 748 if_num = neigh_node->if_incoming->if_num;
749 sum_neigh = orig_node_tmp->bcast_own_sum[if_num];
747 spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); 750 spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock);
748 751
749 if (sum_orig >= sum_neigh) 752 if (sum_orig >= sum_neigh)
diff --git a/net/batman-adv/bitarray.h b/net/batman-adv/bitarray.h
index a081ce1c0514..cebaae7e148b 100644
--- a/net/batman-adv/bitarray.h
+++ b/net/batman-adv/bitarray.h
@@ -20,8 +20,8 @@
20#ifndef _NET_BATMAN_ADV_BITARRAY_H_ 20#ifndef _NET_BATMAN_ADV_BITARRAY_H_
21#define _NET_BATMAN_ADV_BITARRAY_H_ 21#define _NET_BATMAN_ADV_BITARRAY_H_
22 22
23/* returns true if the corresponding bit in the given seq_bits indicates true 23/* Returns 1 if the corresponding bit in the given seq_bits indicates true
24 * and curr_seqno is within range of last_seqno 24 * and curr_seqno is within range of last_seqno. Otherwise returns 0.
25 */ 25 */
26static inline int batadv_test_bit(const unsigned long *seq_bits, 26static inline int batadv_test_bit(const unsigned long *seq_bits,
27 uint32_t last_seqno, uint32_t curr_seqno) 27 uint32_t last_seqno, uint32_t curr_seqno)
@@ -32,7 +32,7 @@ static inline int batadv_test_bit(const unsigned long *seq_bits,
32 if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE) 32 if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE)
33 return 0; 33 return 0;
34 else 34 else
35 return test_bit(diff, seq_bits); 35 return test_bit(diff, seq_bits) != 0;
36} 36}
37 37
38/* turn corresponding bit on, so we can remember that we got the packet */ 38/* turn corresponding bit on, so we can remember that we got the packet */
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 7b683e0bd668..b9a28d2dd3e8 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -107,18 +107,21 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
107{ 107{
108 struct batadv_priv *bat_priv = netdev_priv(dev); 108 struct batadv_priv *bat_priv = netdev_priv(dev);
109 struct sockaddr *addr = p; 109 struct sockaddr *addr = p;
110 uint8_t old_addr[ETH_ALEN];
110 111
111 if (!is_valid_ether_addr(addr->sa_data)) 112 if (!is_valid_ether_addr(addr->sa_data))
112 return -EADDRNOTAVAIL; 113 return -EADDRNOTAVAIL;
113 114
115 memcpy(old_addr, dev->dev_addr, ETH_ALEN);
116 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
117
114 /* only modify transtable if it has been initialized before */ 118 /* only modify transtable if it has been initialized before */
115 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) { 119 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) {
116 batadv_tt_local_remove(bat_priv, dev->dev_addr, 120 batadv_tt_local_remove(bat_priv, old_addr,
117 "mac address changed", false); 121 "mac address changed", false);
118 batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX); 122 batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX);
119 } 123 }
120 124
121 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
122 dev->addr_assign_type &= ~NET_ADDR_RANDOM; 125 dev->addr_assign_type &= ~NET_ADDR_RANDOM;
123 return 0; 126 return 0;
124} 127}