|
@@ -408,7 +408,8 @@ err:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface)
|
|
|
+void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface,
|
|
|
+ enum batadv_hard_if_cleanup autodel)
|
|
|
{
|
|
|
struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
|
|
|
struct batadv_hard_iface *primary_if = NULL;
|
|
@@ -446,7 +447,7 @@ void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface)
|
|
|
dev_put(hard_iface->soft_iface);
|
|
|
|
|
|
/* nobody uses this interface anymore */
|
|
|
- if (!bat_priv->num_ifaces)
|
|
|
+ if (!bat_priv->num_ifaces && autodel == BATADV_IF_CLEANUP_AUTO)
|
|
|
batadv_softif_destroy(hard_iface->soft_iface);
|
|
|
|
|
|
hard_iface->soft_iface = NULL;
|
|
@@ -533,7 +534,8 @@ static void batadv_hardif_remove_interface(struct batadv_hard_iface *hard_iface)
|
|
|
|
|
|
/* first deactivate interface */
|
|
|
if (hard_iface->if_status != BATADV_IF_NOT_IN_USE)
|
|
|
- batadv_hardif_disable_interface(hard_iface);
|
|
|
+ batadv_hardif_disable_interface(hard_iface,
|
|
|
+ BATADV_IF_CLEANUP_AUTO);
|
|
|
|
|
|
if (hard_iface->if_status != BATADV_IF_NOT_IN_USE)
|
|
|
return;
|