hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/batman-adv/hard-interface.h
....@@ -1,19 +1,7 @@
11 /* 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:
33 *
44 * 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/>.
175 */
186
197 #ifndef _NET_BATMAN_ADV_HARD_INTERFACE_H_
....@@ -23,13 +11,12 @@
2311
2412 #include <linux/compiler.h>
2513 #include <linux/kref.h>
14
+#include <linux/netdevice.h>
2615 #include <linux/notifier.h>
2716 #include <linux/rcupdate.h>
2817 #include <linux/stddef.h>
2918 #include <linux/types.h>
30
-
31
-struct net_device;
32
-struct net;
19
+#include <net/net_namespace.h>
3320
3421 /**
3522 * enum batadv_hard_if_state - State of a hard interface
....@@ -113,7 +100,6 @@
113100 struct net *net, const char *iface_name);
114101 void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface,
115102 enum batadv_hard_if_cleanup autodel);
116
-void batadv_hardif_remove_interfaces(void);
117103 int batadv_hardif_min_mtu(struct net_device *soft_iface);
118104 void batadv_update_min_mtu(struct net_device *soft_iface);
119105 void batadv_hardif_release(struct kref *ref);
....@@ -127,6 +113,9 @@
127113 */
128114 static inline void batadv_hardif_put(struct batadv_hard_iface *hard_iface)
129115 {
116
+ if (!hard_iface)
117
+ return;
118
+
130119 kref_put(&hard_iface->refcount, batadv_hardif_release);
131120 }
132121