replace DEPENDS=+@IPV6 with DEPENDS=@IPV6
[feed/routing.git] / batman-adv / patches / 0001-batman-adv-make-sure-ELP-OGM-orig-MAC-is-updated-on-.patch
1 From a636bf0b69010222ea58337d425ca9ff8ce52639 Mon Sep 17 00:00:00 2001
2 From: Antonio Quartulli <a@unstable.cc>
3 Date: Mon, 2 May 2016 18:27:38 +0800
4 Subject: [PATCH 1/6] batman-adv: make sure ELP/OGM orig MAC is updated on
5 address change
6
7 When the MAC address of the primary interface is changed,
8 update the originator address in the ELP and OGM skb buffers as
9 well in order to reflect the change.
10
11 Fixes: a4b88af77e28 ("batman-adv: ELP - adding basic infrastructure")
12 Reported-by: Marek Lindner <marek@neomailbox.ch>
13 Signed-off-by: Antonio Quartulli <a@unstable.cc>
14 Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
15 ---
16 net/batman-adv/bat_v.c | 26 ++++++++++++++++++++++----
17 1 file changed, 22 insertions(+), 4 deletions(-)
18
19 diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
20 index 4026f19..4547fce 100644
21 --- a/net/batman-adv/bat_v.c
22 +++ b/net/batman-adv/bat_v.c
23 @@ -72,16 +72,34 @@ static void batadv_v_iface_disable(struct batadv_hard_iface *hard_iface)
24 batadv_v_elp_iface_disable(hard_iface);
25 }
26
27 -static void batadv_v_iface_update_mac(struct batadv_hard_iface *hard_iface)
28 -{
29 -}
30 -
31 static void batadv_v_primary_iface_set(struct batadv_hard_iface *hard_iface)
32 {
33 batadv_v_elp_primary_iface_set(hard_iface);
34 batadv_v_ogm_primary_iface_set(hard_iface);
35 }
36
37 +/**
38 + * batadv_v_iface_update_mac - react to hard-interface MAC address change
39 + * @hard_iface: the modified interface
40 + *
41 + * If the modified interface is the primary one, update the originator
42 + * address in the ELP and OGM messages to reflect the new MAC address.
43 + */
44 +static void batadv_v_iface_update_mac(struct batadv_hard_iface *hard_iface)
45 +{
46 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
47 + struct batadv_hard_iface *primary_if;
48 +
49 + primary_if = batadv_primary_if_get_selected(bat_priv);
50 + if (primary_if != hard_iface)
51 + goto out;
52 +
53 + batadv_v_primary_iface_set(hard_iface);
54 +out:
55 + if (primary_if)
56 + batadv_hardif_put(primary_if);
57 +}
58 +
59 static void
60 batadv_v_hardif_neigh_init(struct batadv_hardif_neigh_node *hardif_neigh)
61 {
62 --
63 2.8.0.rc3
64