| .. | .. |
|---|
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | | -/* Copyright (C) 2007-2018 B.A.T.M.A.N. contributors: |
|---|
| 2 | +/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors: |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * Marek Lindner, Simon Wunderlich |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of version 2 of the GNU General Public |
|---|
| 8 | | - * License as published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 11 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 13 | | - * General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | 5 | */ |
|---|
| 18 | 6 | |
|---|
| 19 | 7 | #ifndef _NET_BATMAN_ADV_HARD_INTERFACE_H_ |
|---|
| .. | .. |
|---|
| 23 | 11 | |
|---|
| 24 | 12 | #include <linux/compiler.h> |
|---|
| 25 | 13 | #include <linux/kref.h> |
|---|
| 14 | +#include <linux/netdevice.h> |
|---|
| 26 | 15 | #include <linux/notifier.h> |
|---|
| 27 | 16 | #include <linux/rcupdate.h> |
|---|
| 28 | 17 | #include <linux/stddef.h> |
|---|
| 29 | 18 | #include <linux/types.h> |
|---|
| 30 | | - |
|---|
| 31 | | -struct net_device; |
|---|
| 32 | | -struct net; |
|---|
| 19 | +#include <net/net_namespace.h> |
|---|
| 33 | 20 | |
|---|
| 34 | 21 | /** |
|---|
| 35 | 22 | * enum batadv_hard_if_state - State of a hard interface |
|---|
| .. | .. |
|---|
| 113 | 100 | struct net *net, const char *iface_name); |
|---|
| 114 | 101 | void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface, |
|---|
| 115 | 102 | enum batadv_hard_if_cleanup autodel); |
|---|
| 116 | | -void batadv_hardif_remove_interfaces(void); |
|---|
| 117 | 103 | int batadv_hardif_min_mtu(struct net_device *soft_iface); |
|---|
| 118 | 104 | void batadv_update_min_mtu(struct net_device *soft_iface); |
|---|
| 119 | 105 | void batadv_hardif_release(struct kref *ref); |
|---|
| .. | .. |
|---|
| 127 | 113 | */ |
|---|
| 128 | 114 | static inline void batadv_hardif_put(struct batadv_hard_iface *hard_iface) |
|---|
| 129 | 115 | { |
|---|
| 116 | + if (!hard_iface) |
|---|
| 117 | + return; |
|---|
| 118 | + |
|---|
| 130 | 119 | kref_put(&hard_iface->refcount, batadv_hardif_release); |
|---|
| 131 | 120 | } |
|---|
| 132 | 121 | |
|---|