diff options
Diffstat (limited to 'net/batman-adv/hard-interface.c')
-rw-r--r-- | net/batman-adv/hard-interface.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 282bf6e9353e..d112fd6750b0 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -103,13 +103,14 @@ static void batadv_primary_if_update_addr(struct batadv_priv *bat_priv, | |||
103 | { | 103 | { |
104 | struct batadv_vis_packet *vis_packet; | 104 | struct batadv_vis_packet *vis_packet; |
105 | struct batadv_hard_iface *primary_if; | 105 | struct batadv_hard_iface *primary_if; |
106 | struct sk_buff *skb; | ||
106 | 107 | ||
107 | primary_if = batadv_primary_if_get_selected(bat_priv); | 108 | primary_if = batadv_primary_if_get_selected(bat_priv); |
108 | if (!primary_if) | 109 | if (!primary_if) |
109 | goto out; | 110 | goto out; |
110 | 111 | ||
111 | vis_packet = (struct batadv_vis_packet *) | 112 | skb = bat_priv->vis.my_info->skb_packet; |
112 | bat_priv->my_vis_info->skb_packet->data; | 113 | vis_packet = (struct batadv_vis_packet *)skb->data; |
113 | memcpy(vis_packet->vis_orig, primary_if->net_dev->dev_addr, ETH_ALEN); | 114 | memcpy(vis_packet->vis_orig, primary_if->net_dev->dev_addr, ETH_ALEN); |
114 | memcpy(vis_packet->sender_orig, | 115 | memcpy(vis_packet->sender_orig, |
115 | primary_if->net_dev->dev_addr, ETH_ALEN); | 116 | primary_if->net_dev->dev_addr, ETH_ALEN); |
@@ -313,7 +314,13 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, | |||
313 | hard_iface->if_num = bat_priv->num_ifaces; | 314 | hard_iface->if_num = bat_priv->num_ifaces; |
314 | bat_priv->num_ifaces++; | 315 | bat_priv->num_ifaces++; |
315 | hard_iface->if_status = BATADV_IF_INACTIVE; | 316 | hard_iface->if_status = BATADV_IF_INACTIVE; |
316 | batadv_orig_hash_add_if(hard_iface, bat_priv->num_ifaces); | 317 | ret = batadv_orig_hash_add_if(hard_iface, bat_priv->num_ifaces); |
318 | if (ret < 0) { | ||
319 | bat_priv->bat_algo_ops->bat_iface_disable(hard_iface); | ||
320 | bat_priv->num_ifaces--; | ||
321 | hard_iface->if_status = BATADV_IF_NOT_IN_USE; | ||
322 | goto err_dev; | ||
323 | } | ||
317 | 324 | ||
318 | hard_iface->batman_adv_ptype.type = ethertype; | 325 | hard_iface->batman_adv_ptype.type = ethertype; |
319 | hard_iface->batman_adv_ptype.func = batadv_batman_skb_recv; | 326 | hard_iface->batman_adv_ptype.func = batadv_batman_skb_recv; |