The following commit has been merged in the merge/master branch: commit 4e90f564b1049a091604ba64f2943ebde8f2c59b Merge: 586d83871426e3ce5ef46a61e116a8aec9ba04cc f808f1877a5abaf990e6c21daf63edadac849676 Author: Marek Lindner mareklindner@neomailbox.ch Date: Sat May 7 20:36:38 2016 +0800
Merge branch 'next'
diff --combined net/batman-adv/bat_v.c index b52d684,602e03e..d818203 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@@ -39,6 -39,16 +39,16 @@@
static void batadv_v_iface_activate(struct batadv_hard_iface *hard_iface) { + struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); + struct batadv_hard_iface *primary_if; + + primary_if = batadv_primary_if_get_selected(bat_priv); + + if (primary_if) { + batadv_v_elp_iface_activate(primary_if, hard_iface); + batadv_hardif_put(primary_if); + } + /* B.A.T.M.A.N. V does not use any queuing mechanism, therefore it can * set the interface as ACTIVE right away, without any risk of race * condition @@@ -108,6 -118,14 +118,6 @@@ batadv_v_hardif_neigh_init(struct batad batadv_v_elp_throughput_metric_update); }
-static void batadv_v_ogm_schedule(struct batadv_hard_iface *hard_iface) -{ -} - -static void batadv_v_ogm_emit(struct batadv_forw_packet *forw_packet) -{ -} - /** * batadv_v_orig_print_neigh - print neighbors for the originator table * @orig_node: the orig_node for which the neighbors are printed @@@ -321,6 -339,8 +331,6 @@@ static struct batadv_algo_ops batadv_ba .bat_iface_update_mac = batadv_v_iface_update_mac, .bat_primary_iface_set = batadv_v_primary_iface_set, .bat_hardif_neigh_init = batadv_v_hardif_neigh_init, - .bat_ogm_emit = batadv_v_ogm_emit, - .bat_ogm_schedule = batadv_v_ogm_schedule, .bat_orig_print = batadv_v_orig_print, .bat_neigh_cmp = batadv_v_neigh_cmp, .bat_neigh_is_similar_or_better = batadv_v_neigh_is_sob, diff --combined net/batman-adv/bat_v_elp.c index e080340,df42eb1..8909d1e --- a/net/batman-adv/bat_v_elp.c +++ b/net/batman-adv/bat_v_elp.c @@@ -377,6 -377,27 +377,27 @@@ void batadv_v_elp_iface_disable(struct }
/** + * batadv_v_elp_iface_activate - update the ELP buffer belonging to the given + * hard-interface + * @primary_iface: the new primary interface + * @hard_iface: interface holding the to-be-updated buffer + */ + void batadv_v_elp_iface_activate(struct batadv_hard_iface *primary_iface, + struct batadv_hard_iface *hard_iface) + { + struct batadv_elp_packet *elp_packet; + struct sk_buff *skb; + + if (!hard_iface->bat_v.elp_skb) + return; + + skb = hard_iface->bat_v.elp_skb; + elp_packet = (struct batadv_elp_packet *)skb->data; + ether_addr_copy(elp_packet->orig, + primary_iface->net_dev->dev_addr); + } + + /** * batadv_v_elp_primary_iface_set - change internal data to reflect the new * primary interface * @primary_iface: the new primary interface @@@ -384,8 -405,6 +405,6 @@@ void batadv_v_elp_primary_iface_set(struct batadv_hard_iface *primary_iface) { struct batadv_hard_iface *hard_iface; - struct batadv_elp_packet *elp_packet; - struct sk_buff *skb;
/* update orig field of every elp iface belonging to this mesh */ rcu_read_lock(); @@@ -393,13 -412,7 +412,7 @@@ if (primary_iface->soft_iface != hard_iface->soft_iface) continue;
- if (!hard_iface->bat_v.elp_skb) - continue; - - skb = hard_iface->bat_v.elp_skb; - elp_packet = (struct batadv_elp_packet *)skb->data; - ether_addr_copy(elp_packet->orig, - primary_iface->net_dev->dev_addr); + batadv_v_elp_iface_activate(primary_iface, hard_iface); } rcu_read_unlock(); } @@@ -430,8 -443,7 +443,8 @@@ static void batadv_v_elp_neigh_update(s if (!orig_neigh) return;
- neigh = batadv_neigh_node_new(orig_neigh, if_incoming, neigh_addr); + neigh = batadv_neigh_node_get_or_create(orig_neigh, + if_incoming, neigh_addr); if (!neigh) goto orig_free;