diff options
Diffstat (limited to 'net/batman-adv/hard-interface.c')
| -rw-r--r-- | net/batman-adv/hard-interface.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index da000e90f87f..74e3ec2fb116 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
| @@ -408,7 +408,8 @@ err: | |||
| 408 | return ret; | 408 | return ret; |
| 409 | } | 409 | } |
| 410 | 410 | ||
| 411 | void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface) | 411 | void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface, |
| 412 | enum batadv_hard_if_cleanup autodel) | ||
| 412 | { | 413 | { |
| 413 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); | 414 | struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); |
| 414 | struct batadv_hard_iface *primary_if = NULL; | 415 | struct batadv_hard_iface *primary_if = NULL; |
| @@ -446,7 +447,7 @@ void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface) | |||
| 446 | dev_put(hard_iface->soft_iface); | 447 | dev_put(hard_iface->soft_iface); |
| 447 | 448 | ||
| 448 | /* nobody uses this interface anymore */ | 449 | /* nobody uses this interface anymore */ |
| 449 | if (!bat_priv->num_ifaces) | 450 | if (!bat_priv->num_ifaces && autodel == BATADV_IF_CLEANUP_AUTO) |
| 450 | batadv_softif_destroy(hard_iface->soft_iface); | 451 | batadv_softif_destroy(hard_iface->soft_iface); |
| 451 | 452 | ||
| 452 | hard_iface->soft_iface = NULL; | 453 | hard_iface->soft_iface = NULL; |
| @@ -533,7 +534,8 @@ static void batadv_hardif_remove_interface(struct batadv_hard_iface *hard_iface) | |||
| 533 | 534 | ||
| 534 | /* first deactivate interface */ | 535 | /* first deactivate interface */ |
| 535 | if (hard_iface->if_status != BATADV_IF_NOT_IN_USE) | 536 | if (hard_iface->if_status != BATADV_IF_NOT_IN_USE) |
| 536 | batadv_hardif_disable_interface(hard_iface); | 537 | batadv_hardif_disable_interface(hard_iface, |
| 538 | BATADV_IF_CLEANUP_AUTO); | ||
| 537 | 539 | ||
| 538 | if (hard_iface->if_status != BATADV_IF_NOT_IN_USE) | 540 | if (hard_iface->if_status != BATADV_IF_NOT_IN_USE) |
| 539 | return; | 541 | return; |
