summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-03-28 12:52:42 -0400
committerDavid S. Miller <davem@davemloft.net>2019-03-28 12:52:42 -0400
commitede1fd1851467a107f14faace274479dfe28a36c (patch)
tree9376fc5e6bbdca524db4b251c1368dfd406e8ecc
parent356d71e00d278d865f8c7f68adebd6ce4698a7e2 (diff)
parent32e727449c792b689c2a06a8b4cc9fef6270c5a7 (diff)
Merge tag 'batadv-next-for-davem-20190328' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== This feature/cleanup patchset includes the following patches: - Drop license boilerplate (obsoleted by SPDX license IDs), by Sven Eckelmann - Drop documentation for sysfs and debugfs Documentation, by Sven Eckelmann (2 patches) - Mark sysfs as optional and deprecated, by Sven Eckelmann (3 patches) - Update MAINTAINERS Tree, Chat and Bugtracker, by Sven Eckelmann (3 patches) - Rename batadv_dat_send_data, by Sven Eckelmann - update DAT entries with incoming ARP replies, by Linus Luessing - add multicast-to-unicast support for limited destinations, by Linus Luessing ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/ABI/obsolete/sysfs-class-net-batman-adv (renamed from Documentation/ABI/testing/sysfs-class-net-batman-adv)2
-rw-r--r--Documentation/ABI/obsolete/sysfs-class-net-mesh (renamed from Documentation/ABI/testing/sysfs-class-net-mesh)2
-rw-r--r--Documentation/networking/batman-adv.rst110
-rw-r--r--MAINTAINERS7
-rw-r--r--include/uapi/linux/batadv_packet.h12
-rw-r--r--include/uapi/linux/batman_adv.h25
-rw-r--r--net/batman-adv/Kconfig24
-rw-r--r--net/batman-adv/Makefile15
-rw-r--r--net/batman-adv/bat_algo.c12
-rw-r--r--net/batman-adv/bat_algo.h12
-rw-r--r--net/batman-adv/bat_iv_ogm.c12
-rw-r--r--net/batman-adv/bat_iv_ogm.h12
-rw-r--r--net/batman-adv/bat_v.c12
-rw-r--r--net/batman-adv/bat_v.h12
-rw-r--r--net/batman-adv/bat_v_elp.c12
-rw-r--r--net/batman-adv/bat_v_elp.h12
-rw-r--r--net/batman-adv/bat_v_ogm.c12
-rw-r--r--net/batman-adv/bat_v_ogm.h12
-rw-r--r--net/batman-adv/bitarray.c12
-rw-r--r--net/batman-adv/bitarray.h12
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c13
-rw-r--r--net/batman-adv/bridge_loop_avoidance.h12
-rw-r--r--net/batman-adv/debugfs.c12
-rw-r--r--net/batman-adv/debugfs.h12
-rw-r--r--net/batman-adv/distributed-arp-table.c40
-rw-r--r--net/batman-adv/distributed-arp-table.h12
-rw-r--r--net/batman-adv/fragmentation.c12
-rw-r--r--net/batman-adv/fragmentation.h12
-rw-r--r--net/batman-adv/gateway_client.c13
-rw-r--r--net/batman-adv/gateway_client.h12
-rw-r--r--net/batman-adv/gateway_common.c12
-rw-r--r--net/batman-adv/gateway_common.h12
-rw-r--r--net/batman-adv/hard-interface.c12
-rw-r--r--net/batman-adv/hard-interface.h12
-rw-r--r--net/batman-adv/hash.c12
-rw-r--r--net/batman-adv/hash.h12
-rw-r--r--net/batman-adv/icmp_socket.c12
-rw-r--r--net/batman-adv/icmp_socket.h12
-rw-r--r--net/batman-adv/log.c12
-rw-r--r--net/batman-adv/log.h12
-rw-r--r--net/batman-adv/main.c85
-rw-r--r--net/batman-adv/main.h14
-rw-r--r--net/batman-adv/multicast.c211
-rw-r--r--net/batman-adv/multicast.h30
-rw-r--r--net/batman-adv/netlink.c23
-rw-r--r--net/batman-adv/netlink.h12
-rw-r--r--net/batman-adv/network-coding.c12
-rw-r--r--net/batman-adv/network-coding.h12
-rw-r--r--net/batman-adv/originator.c12
-rw-r--r--net/batman-adv/originator.h12
-rw-r--r--net/batman-adv/routing.c12
-rw-r--r--net/batman-adv/routing.h12
-rw-r--r--net/batman-adv/send.c12
-rw-r--r--net/batman-adv/send.h12
-rw-r--r--net/batman-adv/soft-interface.c20
-rw-r--r--net/batman-adv/soft-interface.h12
-rw-r--r--net/batman-adv/sysfs.c128
-rw-r--r--net/batman-adv/sysfs.h50
-rw-r--r--net/batman-adv/tp_meter.c12
-rw-r--r--net/batman-adv/tp_meter.h12
-rw-r--r--net/batman-adv/trace.c12
-rw-r--r--net/batman-adv/trace.h12
-rw-r--r--net/batman-adv/translation-table.c17
-rw-r--r--net/batman-adv/translation-table.h16
-rw-r--r--net/batman-adv/tvlv.c12
-rw-r--r--net/batman-adv/tvlv.h12
-rw-r--r--net/batman-adv/types.h18
67 files changed, 476 insertions, 939 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-net-batman-adv b/Documentation/ABI/obsolete/sysfs-class-net-batman-adv
index 898106849e27..5bdbc8d40256 100644
--- a/Documentation/ABI/testing/sysfs-class-net-batman-adv
+++ b/Documentation/ABI/obsolete/sysfs-class-net-batman-adv
@@ -1,3 +1,5 @@
1This ABI is deprecated and will be removed after 2021. It is
2replaced with the batadv generic netlink family.
1 3
2What: /sys/class/net/<iface>/batman-adv/elp_interval 4What: /sys/class/net/<iface>/batman-adv/elp_interval
3Date: Feb 2014 5Date: Feb 2014
diff --git a/Documentation/ABI/testing/sysfs-class-net-mesh b/Documentation/ABI/obsolete/sysfs-class-net-mesh
index c2b956d44a95..04c1a2932507 100644
--- a/Documentation/ABI/testing/sysfs-class-net-mesh
+++ b/Documentation/ABI/obsolete/sysfs-class-net-mesh
@@ -1,3 +1,5 @@
1This ABI is deprecated and will be removed after 2021. It is
2replaced with the batadv generic netlink family.
1 3
2What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms 4What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
3Date: May 2010 5Date: May 2010
diff --git a/Documentation/networking/batman-adv.rst b/Documentation/networking/batman-adv.rst
index 245fb6c0ab6f..18020943ba25 100644
--- a/Documentation/networking/batman-adv.rst
+++ b/Documentation/networking/batman-adv.rst
@@ -27,24 +27,8 @@ Load the batman-adv module into your kernel::
27 $ insmod batman-adv.ko 27 $ insmod batman-adv.ko
28 28
29The module is now waiting for activation. You must add some interfaces on which 29The module is now waiting for activation. You must add some interfaces on which
30batman can operate. After loading the module batman advanced will scan your 30batman-adv can operate. The batman-adv soft-interface can be created using the
31systems interfaces to search for compatible interfaces. Once found, it will 31iproute2 tool ``ip``::
32create subfolders in the ``/sys`` directories of each supported interface,
33e.g.::
34
35 $ ls /sys/class/net/eth0/batman_adv/
36 elp_interval iface_status mesh_iface throughput_override
37
38If an interface does not have the ``batman_adv`` subfolder, it probably is not
39supported. Not supported interfaces are: loopback, non-ethernet and batman's
40own interfaces.
41
42Note: After the module was loaded it will continuously watch for new
43interfaces to verify the compatibility. There is no need to reload the module
44if you plug your USB wifi adapter into your machine after batman advanced was
45initially loaded.
46
47The batman-adv soft-interface can be created using the iproute2 tool ``ip``::
48 32
49 $ ip link add name bat0 type batadv 33 $ ip link add name bat0 type batadv
50 34
@@ -52,57 +36,46 @@ To activate a given interface simply attach it to the ``bat0`` interface::
52 36
53 $ ip link set dev eth0 master bat0 37 $ ip link set dev eth0 master bat0
54 38
55Repeat this step for all interfaces you wish to add. Now batman starts 39Repeat this step for all interfaces you wish to add. Now batman-adv starts
56using/broadcasting on this/these interface(s). 40using/broadcasting on this/these interface(s).
57 41
58By reading the "iface_status" file you can check its status::
59
60 $ cat /sys/class/net/eth0/batman_adv/iface_status
61 active
62
63To deactivate an interface you have to detach it from the "bat0" interface:: 42To deactivate an interface you have to detach it from the "bat0" interface::
64 43
65 $ ip link set dev eth0 nomaster 44 $ ip link set dev eth0 nomaster
66 45
46The same can also be done using the batctl interface subcommand::
67 47
68All mesh wide settings can be found in batman's own interface folder:: 48 batctl -m bat0 interface create
49 batctl -m bat0 interface add -M eth0
69 50
70 $ ls /sys/class/net/bat0/mesh/ 51To detach eth0 and destroy bat0::
71 aggregated_ogms fragmentation isolation_mark routing_algo
72 ap_isolation gw_bandwidth log_level vlan0
73 bonding gw_mode multicast_mode
74 bridge_loop_avoidance gw_sel_class network_coding
75 distributed_arp_table hop_penalty orig_interval
76 52
77There is a special folder for debugging information:: 53 batctl -m bat0 interface del -M eth0
54 batctl -m bat0 interface destroy
78 55
79 $ ls /sys/kernel/debug/batman_adv/bat0/ 56There are additional settings for each batadv mesh interface, vlan and hardif
80 bla_backbone_table log neighbors transtable_local 57which can be modified using batctl. Detailed information about this can be found
81 bla_claim_table mcast_flags originators 58in its manual.
82 dat_cache nc socket
83 gateways nc_nodes transtable_global
84 59
85Some of the files contain all sort of status information regarding the mesh 60For instance, you can check the current originator interval (value
86network. For example, you can view the table of originators (mesh 61in milliseconds which determines how often batman-adv sends its broadcast
87participants) with:: 62packets)::
88 63
89 $ cat /sys/kernel/debug/batman_adv/bat0/originators 64 $ batctl -M bat0 orig_interval
90
91Other files allow to change batman's behaviour to better fit your requirements.
92For instance, you can check the current originator interval (value in
93milliseconds which determines how often batman sends its broadcast packets)::
94
95 $ cat /sys/class/net/bat0/mesh/orig_interval
96 1000 65 1000
97 66
98and also change its value:: 67and also change its value::
99 68
100 $ echo 3000 > /sys/class/net/bat0/mesh/orig_interval 69 $ batctl -M bat0 orig_interval 3000
101 70
102In very mobile scenarios, you might want to adjust the originator interval to a 71In very mobile scenarios, you might want to adjust the originator interval to a
103lower value. This will make the mesh more responsive to topology changes, but 72lower value. This will make the mesh more responsive to topology changes, but
104will also increase the overhead. 73will also increase the overhead.
105 74
75Information about the current state can be accessed via the batadv generic
76netlink family. batctl provides human readable version via its debug tables
77subcommands.
78
106 79
107Usage 80Usage
108===== 81=====
@@ -147,43 +120,16 @@ batman-adv module. When building batman-adv as part of kernel, use "make
147menuconfig" and enable the option ``B.A.T.M.A.N. debugging`` 120menuconfig" and enable the option ``B.A.T.M.A.N. debugging``
148(``CONFIG_BATMAN_ADV_DEBUG=y``). 121(``CONFIG_BATMAN_ADV_DEBUG=y``).
149 122
150Those additional debug messages can be accessed using a special file in 123Those additional debug messages can be accessed using the perf infrastructure::
151debugfs::
152 124
153 $ cat /sys/kernel/debug/batman_adv/bat0/log 125 $ trace-cmd stream -e batadv:batadv_dbg
154 126
155The additional debug output is by default disabled. It can be enabled during 127The additional debug output is by default disabled. It can be enabled during
156run time. Following log_levels are defined: 128run time::
157 129
158.. flat-table:: 130 $ batctl -m bat0 loglevel routes tt
159 131
160 * - 0 132will enable debug messages for when routes and translation table entries change.
161 - All debug output disabled
162 * - 1
163 - Enable messages related to routing / flooding / broadcasting
164 * - 2
165 - Enable messages related to route added / changed / deleted
166 * - 4
167 - Enable messages related to translation table operations
168 * - 8
169 - Enable messages related to bridge loop avoidance
170 * - 16
171 - Enable messages related to DAT, ARP snooping and parsing
172 * - 32
173 - Enable messages related to network coding
174 * - 64
175 - Enable messages related to multicast
176 * - 128
177 - Enable messages related to throughput meter
178 * - 255
179 - Enable all messages
180
181The debug output can be changed at runtime using the file
182``/sys/class/net/bat0/mesh/log_level``. e.g.::
183
184 $ echo 6 > /sys/class/net/bat0/mesh/log_level
185
186will enable debug messages for when routes change.
187 133
188Counters for different types of packets entering and leaving the batman-adv 134Counters for different types of packets entering and leaving the batman-adv
189module are available through ethtool:: 135module are available through ethtool::
diff --git a/MAINTAINERS b/MAINTAINERS
index 3e5a5d263f29..35cc403471ea 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2793,10 +2793,13 @@ M: Simon Wunderlich <sw@simonwunderlich.de>
2793M: Antonio Quartulli <a@unstable.cc> 2793M: Antonio Quartulli <a@unstable.cc>
2794L: b.a.t.m.a.n@lists.open-mesh.org (moderated for non-subscribers) 2794L: b.a.t.m.a.n@lists.open-mesh.org (moderated for non-subscribers)
2795W: https://www.open-mesh.org/ 2795W: https://www.open-mesh.org/
2796B: https://www.open-mesh.org/projects/batman-adv/issues
2797C: irc://chat.freenode.net/batman
2796Q: https://patchwork.open-mesh.org/project/batman/list/ 2798Q: https://patchwork.open-mesh.org/project/batman/list/
2799T: git https://git.open-mesh.org/linux-merge.git
2797S: Maintained 2800S: Maintained
2798F: Documentation/ABI/testing/sysfs-class-net-batman-adv 2801F: Documentation/ABI/obsolete/sysfs-class-net-batman-adv
2799F: Documentation/ABI/testing/sysfs-class-net-mesh 2802F: Documentation/ABI/obsolete/sysfs-class-net-mesh
2800F: Documentation/networking/batman-adv.rst 2803F: Documentation/networking/batman-adv.rst
2801F: include/uapi/linux/batadv_packet.h 2804F: include/uapi/linux/batadv_packet.h
2802F: include/uapi/linux/batman_adv.h 2805F: include/uapi/linux/batman_adv.h
diff --git a/include/uapi/linux/batadv_packet.h b/include/uapi/linux/batadv_packet.h
index c99336f4eefe..4ebc2135e950 100644
--- a/include/uapi/linux/batadv_packet.h
+++ b/include/uapi/linux/batadv_packet.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _UAPI_LINUX_BATADV_PACKET_H_ 7#ifndef _UAPI_LINUX_BATADV_PACKET_H_
diff --git a/include/uapi/linux/batman_adv.h b/include/uapi/linux/batman_adv.h
index 305bf316dd03..67f4636758af 100644
--- a/include/uapi/linux/batman_adv.h
+++ b/include/uapi/linux/batman_adv.h
@@ -2,24 +2,6 @@
2/* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Matthias Schiffer 4 * Matthias Schiffer
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 5 */
24 6
25#ifndef _UAPI_LINUX_BATMAN_ADV_H_ 7#ifndef _UAPI_LINUX_BATMAN_ADV_H_
@@ -491,6 +473,13 @@ enum batadv_nl_attrs {
491 */ 473 */
492 BATADV_ATTR_THROUGHPUT_OVERRIDE, 474 BATADV_ATTR_THROUGHPUT_OVERRIDE,
493 475
476 /**
477 * @BATADV_ATTR_MULTICAST_FANOUT: defines the maximum number of packet
478 * copies that may be generated for a multicast-to-unicast conversion.
479 * Once this limit is exceeded distribution will fall back to broadcast.
480 */
481 BATADV_ATTR_MULTICAST_FANOUT,
482
494 /* add attributes above here, update the policy in netlink.c */ 483 /* add attributes above here, update the policy in netlink.c */
495 484
496 /** 485 /**
diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
index a31db5e9ac8e..a3d188dfbe75 100644
--- a/net/batman-adv/Kconfig
+++ b/net/batman-adv/Kconfig
@@ -2,18 +2,6 @@
2# Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2# Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3# 3#
4# Marek Lindner, Simon Wunderlich 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# B.A.T.M.A.N meshing protocol 7# B.A.T.M.A.N meshing protocol
@@ -109,6 +97,18 @@ config BATMAN_ADV_DEBUG
109 buffer. The output is controlled via the batadv netdev specific 97 buffer. The output is controlled via the batadv netdev specific
110 log_level setting. 98 log_level setting.
111 99
100config BATMAN_ADV_SYSFS
101 bool "batman-adv sysfs entries"
102 depends on BATMAN_ADV
103 default y
104 help
105 Say Y here if you want to enable batman-adv device configuration and
106 status interface through sysfs attributes. It is replaced by the
107 batadv generic netlink family but still used by various userspace
108 tools and scripts.
109
110 If unsure, say Y.
111
112config BATMAN_ADV_TRACING 112config BATMAN_ADV_TRACING
113 bool "B.A.T.M.A.N. tracing support" 113 bool "B.A.T.M.A.N. tracing support"
114 depends on BATMAN_ADV 114 depends on BATMAN_ADV
diff --git a/net/batman-adv/Makefile b/net/batman-adv/Makefile
index a887ecc3efa1..fd63e116d9ff 100644
--- a/net/batman-adv/Makefile
+++ b/net/batman-adv/Makefile
@@ -2,19 +2,6 @@
2# Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2# Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3# 3#
4# Marek Lindner, Simon Wunderlich 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#
18 5
19obj-$(CONFIG_BATMAN_ADV) += batman-adv.o 6obj-$(CONFIG_BATMAN_ADV) += batman-adv.o
20batman-adv-y += bat_algo.o 7batman-adv-y += bat_algo.o
@@ -41,7 +28,7 @@ batman-adv-y += originator.o
41batman-adv-y += routing.o 28batman-adv-y += routing.o
42batman-adv-y += send.o 29batman-adv-y += send.o
43batman-adv-y += soft-interface.o 30batman-adv-y += soft-interface.o
44batman-adv-y += sysfs.o 31batman-adv-$(CONFIG_BATMAN_ADV_SYSFS) += sysfs.o
45batman-adv-$(CONFIG_BATMAN_ADV_TRACING) += trace.o 32batman-adv-$(CONFIG_BATMAN_ADV_TRACING) += trace.o
46batman-adv-y += tp_meter.o 33batman-adv-y += tp_meter.o
47batman-adv-y += translation-table.o 34batman-adv-y += translation-table.o
diff --git a/net/batman-adv/bat_algo.c b/net/batman-adv/bat_algo.c
index 7b7e15641fef..fa39eaaab9d7 100644
--- a/net/batman-adv/bat_algo.c
+++ b/net/batman-adv/bat_algo.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#include "main.h" 7#include "main.h"
diff --git a/net/batman-adv/bat_algo.h b/net/batman-adv/bat_algo.h
index 25e7bb51928c..cb7d57d16c9d 100644
--- a/net/batman-adv/bat_algo.h
+++ b/net/batman-adv/bat_algo.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Linus Lüssing 4 * Marek Lindner, Linus Lüssing
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#ifndef _NET_BATMAN_ADV_BAT_ALGO_H_ 7#ifndef _NET_BATMAN_ADV_BAT_ALGO_H_
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index de61091af666..bd4138ddf7e0 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#include "bat_iv_ogm.h" 7#include "bat_iv_ogm.h"
diff --git a/net/batman-adv/bat_iv_ogm.h b/net/batman-adv/bat_iv_ogm.h
index 785f6666273c..c7a9ba305bfc 100644
--- a/net/batman-adv/bat_iv_ogm.h
+++ b/net/batman-adv/bat_iv_ogm.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _NET_BATMAN_ADV_BAT_IV_OGM_H_ 7#ifndef _NET_BATMAN_ADV_BAT_IV_OGM_H_
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 445594ed58af..231b4aab4d8d 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Linus Lüssing, Marek Lindner 4 * Linus Lüssing, Marek Lindner
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#include "bat_v.h" 7#include "bat_v.h"
diff --git a/net/batman-adv/bat_v.h b/net/batman-adv/bat_v.h
index 465a4fc23354..37833db098e6 100644
--- a/net/batman-adv/bat_v.h
+++ b/net/batman-adv/bat_v.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Linus Lüssing 4 * Marek Lindner, Linus Lüssing
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#ifndef _NET_BATMAN_ADV_BAT_V_H_ 7#ifndef _NET_BATMAN_ADV_BAT_V_H_
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index a9b7919c9de5..13b9ab860a25 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Linus Lüssing, Marek Lindner 4 * Linus Lüssing, Marek Lindner
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#include "bat_v_elp.h" 7#include "bat_v_elp.h"
diff --git a/net/batman-adv/bat_v_elp.h b/net/batman-adv/bat_v_elp.h
index 75f189ee4a1c..bb3d40f73bfe 100644
--- a/net/batman-adv/bat_v_elp.h
+++ b/net/batman-adv/bat_v_elp.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Linus Lüssing, Marek Lindner 4 * Linus Lüssing, Marek Lindner
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#ifndef _NET_BATMAN_ADV_BAT_V_ELP_H_ 7#ifndef _NET_BATMAN_ADV_BAT_V_ELP_H_
diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c
index c9698ad41854..fad95ef64e01 100644
--- a/net/batman-adv/bat_v_ogm.c
+++ b/net/batman-adv/bat_v_ogm.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Antonio Quartulli 4 * Antonio Quartulli
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#include "bat_v_ogm.h" 7#include "bat_v_ogm.h"
diff --git a/net/batman-adv/bat_v_ogm.h b/net/batman-adv/bat_v_ogm.h
index f67cf7ee06b2..616bf2ea8755 100644
--- a/net/batman-adv/bat_v_ogm.h
+++ b/net/batman-adv/bat_v_ogm.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Antonio Quartulli 4 * Antonio Quartulli
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#ifndef _NET_BATMAN_ADV_BAT_V_OGM_H_ 7#ifndef _NET_BATMAN_ADV_BAT_V_OGM_H_
diff --git a/net/batman-adv/bitarray.c b/net/batman-adv/bitarray.c
index 63e134e763e3..7f04a6acf14e 100644
--- a/net/batman-adv/bitarray.c
+++ b/net/batman-adv/bitarray.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Simon Wunderlich, Marek Lindner 4 * Simon Wunderlich, Marek Lindner
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#include "bitarray.h" 7#include "bitarray.h"
diff --git a/net/batman-adv/bitarray.h b/net/batman-adv/bitarray.h
index f3a05ad9afad..84ad2d2b6ac9 100644
--- a/net/batman-adv/bitarray.h
+++ b/net/batman-adv/bitarray.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Simon Wunderlich, Marek Lindner 4 * Simon Wunderlich, Marek Lindner
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#ifndef _NET_BATMAN_ADV_BITARRAY_H_ 7#ifndef _NET_BATMAN_ADV_BITARRAY_H_
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index ef39aabdb694..8d6b7c9c2a7e 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Simon Wunderlich 4 * 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#include "bridge_loop_avoidance.h" 7#include "bridge_loop_avoidance.h"
@@ -59,7 +47,6 @@
59#include "netlink.h" 47#include "netlink.h"
60#include "originator.h" 48#include "originator.h"
61#include "soft-interface.h" 49#include "soft-interface.h"
62#include "sysfs.h"
63#include "translation-table.h" 50#include "translation-table.h"
64 51
65static const u8 batadv_announce_mac[4] = {0x43, 0x05, 0x43, 0x05}; 52static const u8 batadv_announce_mac[4] = {0x43, 0x05, 0x43, 0x05};
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h
index 31771c751efb..012d72c8d064 100644
--- a/net/batman-adv/bridge_loop_avoidance.h
+++ b/net/batman-adv/bridge_loop_avoidance.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Simon Wunderlich 4 * 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#ifndef _NET_BATMAN_ADV_BLA_H_ 7#ifndef _NET_BATMAN_ADV_BLA_H_
diff --git a/net/batman-adv/debugfs.c b/net/batman-adv/debugfs.c
index 3b9d1ad2f467..d38d70ccdd5a 100644
--- a/net/batman-adv/debugfs.c
+++ b/net/batman-adv/debugfs.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#include "debugfs.h" 7#include "debugfs.h"
diff --git a/net/batman-adv/debugfs.h b/net/batman-adv/debugfs.h
index c0b8694041ec..7fac680cf740 100644
--- a/net/batman-adv/debugfs.h
+++ b/net/batman-adv/debugfs.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#ifndef _NET_BATMAN_ADV_DEBUGFS_H_ 7#ifndef _NET_BATMAN_ADV_DEBUGFS_H_
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 310a4f353008..b0af3a11d406 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Antonio Quartulli 4 * Antonio Quartulli
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#include "distributed-arp-table.h" 7#include "distributed-arp-table.h"
@@ -667,7 +655,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst,
667} 655}
668 656
669/** 657/**
670 * batadv_dat_send_data() - send a payload to the selected candidates 658 * batadv_dat_forward_data() - copy and send payload to the selected candidates
671 * @bat_priv: the bat priv with all the soft interface information 659 * @bat_priv: the bat priv with all the soft interface information
672 * @skb: payload to send 660 * @skb: payload to send
673 * @ip: the DHT key 661 * @ip: the DHT key
@@ -680,9 +668,9 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst,
680 * Return: true if the packet is sent to at least one candidate, false 668 * Return: true if the packet is sent to at least one candidate, false
681 * otherwise. 669 * otherwise.
682 */ 670 */
683static bool batadv_dat_send_data(struct batadv_priv *bat_priv, 671static bool batadv_dat_forward_data(struct batadv_priv *bat_priv,
684 struct sk_buff *skb, __be32 ip, 672 struct sk_buff *skb, __be32 ip,
685 unsigned short vid, int packet_subtype) 673 unsigned short vid, int packet_subtype)
686{ 674{
687 int i; 675 int i;
688 bool ret = false; 676 bool ret = false;
@@ -1277,8 +1265,8 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
1277 ret = true; 1265 ret = true;
1278 } else { 1266 } else {
1279 /* Send the request to the DHT */ 1267 /* Send the request to the DHT */
1280 ret = batadv_dat_send_data(bat_priv, skb, ip_dst, vid, 1268 ret = batadv_dat_forward_data(bat_priv, skb, ip_dst, vid,
1281 BATADV_P_DAT_DHT_GET); 1269 BATADV_P_DAT_DHT_GET);
1282 } 1270 }
1283out: 1271out:
1284 if (dat_entry) 1272 if (dat_entry)
@@ -1392,8 +1380,10 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
1392 /* Send the ARP reply to the candidates for both the IP addresses that 1380 /* Send the ARP reply to the candidates for both the IP addresses that
1393 * the node obtained from the ARP reply 1381 * the node obtained from the ARP reply
1394 */ 1382 */
1395 batadv_dat_send_data(bat_priv, skb, ip_src, vid, BATADV_P_DAT_DHT_PUT); 1383 batadv_dat_forward_data(bat_priv, skb, ip_src, vid,
1396 batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT); 1384 BATADV_P_DAT_DHT_PUT);
1385 batadv_dat_forward_data(bat_priv, skb, ip_dst, vid,
1386 BATADV_P_DAT_DHT_PUT);
1397} 1387}
1398 1388
1399/** 1389/**
@@ -1444,7 +1434,6 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
1444 hw_src, &ip_src, hw_dst, &ip_dst, 1434 hw_src, &ip_src, hw_dst, &ip_dst,
1445 dat_entry->mac_addr, &dat_entry->ip); 1435 dat_entry->mac_addr, &dat_entry->ip);
1446 dropped = true; 1436 dropped = true;
1447 goto out;
1448 } 1437 }
1449 1438
1450 /* Update our internal cache with both the IP addresses the node got 1439 /* Update our internal cache with both the IP addresses the node got
@@ -1453,6 +1442,9 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
1453 batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid); 1442 batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid);
1454 batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid); 1443 batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid);
1455 1444
1445 if (dropped)
1446 goto out;
1447
1456 /* If BLA is enabled, only forward ARP replies if we have claimed the 1448 /* If BLA is enabled, only forward ARP replies if we have claimed the
1457 * source of the ARP reply or if no one else of the same backbone has 1449 * source of the ARP reply or if no one else of the same backbone has
1458 * already claimed that client. This prevents that different gateways 1450 * already claimed that client. This prevents that different gateways
@@ -1708,8 +1700,10 @@ static void batadv_dat_put_dhcp(struct batadv_priv *bat_priv, u8 *chaddr,
1708 batadv_dat_entry_add(bat_priv, yiaddr, chaddr, vid); 1700 batadv_dat_entry_add(bat_priv, yiaddr, chaddr, vid);
1709 batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid); 1701 batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid);
1710 1702
1711 batadv_dat_send_data(bat_priv, skb, yiaddr, vid, BATADV_P_DAT_DHT_PUT); 1703 batadv_dat_forward_data(bat_priv, skb, yiaddr, vid,
1712 batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT); 1704 BATADV_P_DAT_DHT_PUT);
1705 batadv_dat_forward_data(bat_priv, skb, ip_dst, vid,
1706 BATADV_P_DAT_DHT_PUT);
1713 1707
1714 consume_skb(skb); 1708 consume_skb(skb);
1715 1709
diff --git a/net/batman-adv/distributed-arp-table.h b/net/batman-adv/distributed-arp-table.h
index 68c0ff321acd..110c27447d70 100644
--- a/net/batman-adv/distributed-arp-table.h
+++ b/net/batman-adv/distributed-arp-table.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Antonio Quartulli 4 * Antonio Quartulli
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#ifndef _NET_BATMAN_ADV_DISTRIBUTED_ARP_TABLE_H_ 7#ifndef _NET_BATMAN_ADV_DISTRIBUTED_ARP_TABLE_H_
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index b506d15b8230..385fccdcf69d 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Martin Hundebøll <martin@hundeboll.net> 4 * Martin Hundebøll <martin@hundeboll.net>
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#include "fragmentation.h" 7#include "fragmentation.h"
diff --git a/net/batman-adv/fragmentation.h b/net/batman-adv/fragmentation.h
index abdac26579bf..d6074ba2ada7 100644
--- a/net/batman-adv/fragmentation.h
+++ b/net/batman-adv/fragmentation.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Martin Hundebøll <martin@hundeboll.net> 4 * Martin Hundebøll <martin@hundeboll.net>
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#ifndef _NET_BATMAN_ADV_FRAGMENTATION_H_ 7#ifndef _NET_BATMAN_ADV_FRAGMENTATION_H_
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index f5811f61aa92..47df4c678988 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#include "gateway_client.h" 7#include "gateway_client.h"
@@ -53,7 +41,6 @@
53#include "originator.h" 41#include "originator.h"
54#include "routing.h" 42#include "routing.h"
55#include "soft-interface.h" 43#include "soft-interface.h"
56#include "sysfs.h"
57#include "translation-table.h" 44#include "translation-table.h"
58 45
59/* These are the offsets of the "hw type" and "hw address length" in the dhcp 46/* These are the offsets of the "hw type" and "hw address length" in the dhcp
diff --git a/net/batman-adv/gateway_client.h b/net/batman-adv/gateway_client.h
index b5732c8be81a..0e14026feebd 100644
--- a/net/batman-adv/gateway_client.h
+++ b/net/batman-adv/gateway_client.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#ifndef _NET_BATMAN_ADV_GATEWAY_CLIENT_H_ 7#ifndef _NET_BATMAN_ADV_GATEWAY_CLIENT_H_
diff --git a/net/batman-adv/gateway_common.c b/net/batman-adv/gateway_common.c
index e064de45e22c..dac097f9be03 100644
--- a/net/batman-adv/gateway_common.c
+++ b/net/batman-adv/gateway_common.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#include "gateway_common.h" 7#include "gateway_common.h"
diff --git a/net/batman-adv/gateway_common.h b/net/batman-adv/gateway_common.h
index 128467a0fb89..5cf50736c635 100644
--- a/net/batman-adv/gateway_common.h
+++ b/net/batman-adv/gateway_common.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_ 7#ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 96ef7c70b4d9..79d1731b8306 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#include "hard-interface.h" 7#include "hard-interface.h"
diff --git a/net/batman-adv/hard-interface.h b/net/batman-adv/hard-interface.h
index 48de28c83401..c8ef6aa0e865 100644
--- a/net/batman-adv/hard-interface.h
+++ b/net/batman-adv/hard-interface.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _NET_BATMAN_ADV_HARD_INTERFACE_H_ 7#ifndef _NET_BATMAN_ADV_HARD_INTERFACE_H_
diff --git a/net/batman-adv/hash.c b/net/batman-adv/hash.c
index 56a08ce193d5..a9d4e176f4de 100644
--- a/net/batman-adv/hash.c
+++ b/net/batman-adv/hash.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Simon Wunderlich, Marek Lindner 4 * Simon Wunderlich, Marek Lindner
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#include "hash.h" 7#include "hash.h"
diff --git a/net/batman-adv/hash.h b/net/batman-adv/hash.h
index 37507b6d4006..ceef171f7f98 100644
--- a/net/batman-adv/hash.h
+++ b/net/batman-adv/hash.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Simon Wunderlich, Marek Lindner 4 * Simon Wunderlich, Marek Lindner
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#ifndef _NET_BATMAN_ADV_HASH_H_ 7#ifndef _NET_BATMAN_ADV_HASH_H_
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index 9859ababb82e..de81b5ecad91 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#include "icmp_socket.h" 7#include "icmp_socket.h"
diff --git a/net/batman-adv/icmp_socket.h b/net/batman-adv/icmp_socket.h
index 5f8926522ff0..35eecbfd2e65 100644
--- a/net/batman-adv/icmp_socket.h
+++ b/net/batman-adv/icmp_socket.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#ifndef _NET_BATMAN_ADV_ICMP_SOCKET_H_ 7#ifndef _NET_BATMAN_ADV_ICMP_SOCKET_H_
diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c
index 3e610df8debf..60ce11e16a90 100644
--- a/net/batman-adv/log.c
+++ b/net/batman-adv/log.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#include "log.h" 7#include "log.h"
diff --git a/net/batman-adv/log.h b/net/batman-adv/log.h
index 660e9bcc85a2..5504637e63d8 100644
--- a/net/batman-adv/log.h
+++ b/net/batman-adv/log.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _NET_BATMAN_ADV_LOG_H_ 7#ifndef _NET_BATMAN_ADV_LOG_H_
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 75750870cf04..dabcaff87e34 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#include "main.h" 7#include "main.h"
@@ -22,6 +10,7 @@
22#include <linux/build_bug.h> 10#include <linux/build_bug.h>
23#include <linux/byteorder/generic.h> 11#include <linux/byteorder/generic.h>
24#include <linux/crc32c.h> 12#include <linux/crc32c.h>
13#include <linux/device.h>
25#include <linux/errno.h> 14#include <linux/errno.h>
26#include <linux/genetlink.h> 15#include <linux/genetlink.h>
27#include <linux/gfp.h> 16#include <linux/gfp.h>
@@ -31,6 +20,7 @@
31#include <linux/ip.h> 20#include <linux/ip.h>
32#include <linux/ipv6.h> 21#include <linux/ipv6.h>
33#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/kobject.h>
34#include <linux/kref.h> 24#include <linux/kref.h>
35#include <linux/list.h> 25#include <linux/list.h>
36#include <linux/module.h> 26#include <linux/module.h>
@@ -40,6 +30,7 @@
40#include <linux/rcupdate.h> 30#include <linux/rcupdate.h>
41#include <linux/seq_file.h> 31#include <linux/seq_file.h>
42#include <linux/skbuff.h> 32#include <linux/skbuff.h>
33#include <linux/slab.h>
43#include <linux/spinlock.h> 34#include <linux/spinlock.h>
44#include <linux/stddef.h> 35#include <linux/stddef.h>
45#include <linux/string.h> 36#include <linux/string.h>
@@ -84,6 +75,22 @@ struct workqueue_struct *batadv_event_workqueue;
84 75
85static void batadv_recv_handler_init(void); 76static void batadv_recv_handler_init(void);
86 77
78#define BATADV_UEV_TYPE_VAR "BATTYPE="
79#define BATADV_UEV_ACTION_VAR "BATACTION="
80#define BATADV_UEV_DATA_VAR "BATDATA="
81
82static char *batadv_uev_action_str[] = {
83 "add",
84 "del",
85 "change",
86 "loopdetect",
87};
88
89static char *batadv_uev_type_str[] = {
90 "gw",
91 "bla",
92};
93
87static int __init batadv_init(void) 94static int __init batadv_init(void)
88{ 95{
89 int ret; 96 int ret;
@@ -678,6 +685,60 @@ bool batadv_vlan_ap_isola_get(struct batadv_priv *bat_priv, unsigned short vid)
678 return ap_isolation_enabled; 685 return ap_isolation_enabled;
679} 686}
680 687
688/**
689 * batadv_throw_uevent() - Send an uevent with batman-adv specific env data
690 * @bat_priv: the bat priv with all the soft interface information
691 * @type: subsystem type of event. Stored in uevent's BATTYPE
692 * @action: action type of event. Stored in uevent's BATACTION
693 * @data: string with additional information to the event (ignored for
694 * BATADV_UEV_DEL). Stored in uevent's BATDATA
695 *
696 * Return: 0 on success or negative error number in case of failure
697 */
698int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type,
699 enum batadv_uev_action action, const char *data)
700{
701 int ret = -ENOMEM;
702 struct kobject *bat_kobj;
703 char *uevent_env[4] = { NULL, NULL, NULL, NULL };
704
705 bat_kobj = &bat_priv->soft_iface->dev.kobj;
706
707 uevent_env[0] = kasprintf(GFP_ATOMIC,
708 "%s%s", BATADV_UEV_TYPE_VAR,
709 batadv_uev_type_str[type]);
710 if (!uevent_env[0])
711 goto out;
712
713 uevent_env[1] = kasprintf(GFP_ATOMIC,
714 "%s%s", BATADV_UEV_ACTION_VAR,
715 batadv_uev_action_str[action]);
716 if (!uevent_env[1])
717 goto out;
718
719 /* If the event is DEL, ignore the data field */
720 if (action != BATADV_UEV_DEL) {
721 uevent_env[2] = kasprintf(GFP_ATOMIC,
722 "%s%s", BATADV_UEV_DATA_VAR, data);
723 if (!uevent_env[2])
724 goto out;
725 }
726
727 ret = kobject_uevent_env(bat_kobj, KOBJ_CHANGE, uevent_env);
728out:
729 kfree(uevent_env[0]);
730 kfree(uevent_env[1]);
731 kfree(uevent_env[2]);
732
733 if (ret)
734 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
735 "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",
736 batadv_uev_type_str[type],
737 batadv_uev_action_str[action],
738 (action == BATADV_UEV_DEL ? "NULL" : data), ret);
739 return ret;
740}
741
681module_init(batadv_init); 742module_init(batadv_init);
682module_exit(batadv_exit); 743module_exit(batadv_exit);
683 744
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 3ed669d7dc6b..f827e441025f 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _NET_BATMAN_ADV_MAIN_H_ 7#ifndef _NET_BATMAN_ADV_MAIN_H_
@@ -394,5 +382,7 @@ static inline void batadv_add_counter(struct batadv_priv *bat_priv, size_t idx,
394 382
395unsigned short batadv_get_vid(struct sk_buff *skb, size_t header_len); 383unsigned short batadv_get_vid(struct sk_buff *skb, size_t header_len);
396bool batadv_vlan_ap_isola_get(struct batadv_priv *bat_priv, unsigned short vid); 384bool batadv_vlan_ap_isola_get(struct batadv_priv *bat_priv, unsigned short vid);
385int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type,
386 enum batadv_uev_action action, const char *data);
397 387
398#endif /* _NET_BATMAN_ADV_MAIN_H_ */ 388#endif /* _NET_BATMAN_ADV_MAIN_H_ */
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index f91b1b6265cf..3feb9435b715 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2014-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2014-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Linus Lüssing 4 * Linus Lüssing
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#include "multicast.h" 7#include "multicast.h"
@@ -66,6 +54,7 @@
66#include "hash.h" 54#include "hash.h"
67#include "log.h" 55#include "log.h"
68#include "netlink.h" 56#include "netlink.h"
57#include "send.h"
69#include "soft-interface.h" 58#include "soft-interface.h"
70#include "translation-table.h" 59#include "translation-table.h"
71#include "tvlv.h" 60#include "tvlv.h"
@@ -991,6 +980,7 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
991{ 980{
992 int ret, tt_count, ip_count, unsnoop_count, total_count; 981 int ret, tt_count, ip_count, unsnoop_count, total_count;
993 bool is_unsnoopable = false; 982 bool is_unsnoopable = false;
983 unsigned int mcast_fanout;
994 struct ethhdr *ethhdr; 984 struct ethhdr *ethhdr;
995 985
996 ret = batadv_mcast_forw_mode_check(bat_priv, skb, &is_unsnoopable); 986 ret = batadv_mcast_forw_mode_check(bat_priv, skb, &is_unsnoopable);
@@ -1025,8 +1015,203 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
1025 case 0: 1015 case 0:
1026 return BATADV_FORW_NONE; 1016 return BATADV_FORW_NONE;
1027 default: 1017 default:
1028 return BATADV_FORW_ALL; 1018 mcast_fanout = atomic_read(&bat_priv->multicast_fanout);
1019
1020 if (!unsnoop_count && total_count <= mcast_fanout)
1021 return BATADV_FORW_SOME;
1029 } 1022 }
1023
1024 return BATADV_FORW_ALL;
1025}
1026
1027/**
1028 * batadv_mcast_forw_tt() - forwards a packet to multicast listeners
1029 * @bat_priv: the bat priv with all the soft interface information
1030 * @skb: the multicast packet to transmit
1031 * @vid: the vlan identifier
1032 *
1033 * Sends copies of a frame with multicast destination to any multicast
1034 * listener registered in the translation table. A transmission is performed
1035 * via a batman-adv unicast packet for each such destination node.
1036 *
1037 * Return: NET_XMIT_DROP on memory allocation failure, NET_XMIT_SUCCESS
1038 * otherwise.
1039 */
1040static int
1041batadv_mcast_forw_tt(struct batadv_priv *bat_priv, struct sk_buff *skb,
1042 unsigned short vid)
1043{
1044 int ret = NET_XMIT_SUCCESS;
1045 struct sk_buff *newskb;
1046
1047 struct batadv_tt_orig_list_entry *orig_entry;
1048
1049 struct batadv_tt_global_entry *tt_global;
1050 const u8 *addr = eth_hdr(skb)->h_dest;
1051
1052 tt_global = batadv_tt_global_hash_find(bat_priv, addr, vid);
1053 if (!tt_global)
1054 goto out;
1055
1056 rcu_read_lock();
1057 hlist_for_each_entry_rcu(orig_entry, &tt_global->orig_list, list) {
1058 newskb = skb_copy(skb, GFP_ATOMIC);
1059 if (!newskb) {
1060 ret = NET_XMIT_DROP;
1061 break;
1062 }
1063
1064 batadv_send_skb_unicast(bat_priv, newskb, BATADV_UNICAST, 0,
1065 orig_entry->orig_node, vid);
1066 }
1067 rcu_read_unlock();
1068
1069 batadv_tt_global_entry_put(tt_global);
1070
1071out:
1072 return ret;
1073}
1074
1075/**
1076 * batadv_mcast_forw_want_all_ipv4() - forward to nodes with want-all-ipv4
1077 * @bat_priv: the bat priv with all the soft interface information
1078 * @skb: the multicast packet to transmit
1079 * @vid: the vlan identifier
1080 *
1081 * Sends copies of a frame with multicast destination to any node with a
1082 * BATADV_MCAST_WANT_ALL_IPV4 flag set. A transmission is performed via a
1083 * batman-adv unicast packet for each such destination node.
1084 *
1085 * Return: NET_XMIT_DROP on memory allocation failure, NET_XMIT_SUCCESS
1086 * otherwise.
1087 */
1088static int
1089batadv_mcast_forw_want_all_ipv4(struct batadv_priv *bat_priv,
1090 struct sk_buff *skb, unsigned short vid)
1091{
1092 struct batadv_orig_node *orig_node;
1093 int ret = NET_XMIT_SUCCESS;
1094 struct sk_buff *newskb;
1095
1096 rcu_read_lock();
1097 hlist_for_each_entry_rcu(orig_node,
1098 &bat_priv->mcast.want_all_ipv4_list,
1099 mcast_want_all_ipv4_node) {
1100 newskb = skb_copy(skb, GFP_ATOMIC);
1101 if (!newskb) {
1102 ret = NET_XMIT_DROP;
1103 break;
1104 }
1105
1106 batadv_send_skb_unicast(bat_priv, newskb, BATADV_UNICAST, 0,
1107 orig_node, vid);
1108 }
1109 rcu_read_unlock();
1110 return ret;
1111}
1112
1113/**
1114 * batadv_mcast_forw_want_all_ipv6() - forward to nodes with want-all-ipv6
1115 * @bat_priv: the bat priv with all the soft interface information
1116 * @skb: The multicast packet to transmit
1117 * @vid: the vlan identifier
1118 *
1119 * Sends copies of a frame with multicast destination to any node with a
1120 * BATADV_MCAST_WANT_ALL_IPV6 flag set. A transmission is performed via a
1121 * batman-adv unicast packet for each such destination node.
1122 *
1123 * Return: NET_XMIT_DROP on memory allocation failure, NET_XMIT_SUCCESS
1124 * otherwise.
1125 */
1126static int
1127batadv_mcast_forw_want_all_ipv6(struct batadv_priv *bat_priv,
1128 struct sk_buff *skb, unsigned short vid)
1129{
1130 struct batadv_orig_node *orig_node;
1131 int ret = NET_XMIT_SUCCESS;
1132 struct sk_buff *newskb;
1133
1134 rcu_read_lock();
1135 hlist_for_each_entry_rcu(orig_node,
1136 &bat_priv->mcast.want_all_ipv6_list,
1137 mcast_want_all_ipv6_node) {
1138 newskb = skb_copy(skb, GFP_ATOMIC);
1139 if (!newskb) {
1140 ret = NET_XMIT_DROP;
1141 break;
1142 }
1143
1144 batadv_send_skb_unicast(bat_priv, newskb, BATADV_UNICAST, 0,
1145 orig_node, vid);
1146 }
1147 rcu_read_unlock();
1148 return ret;
1149}
1150
1151/**
1152 * batadv_mcast_forw_want_all() - forward packet to nodes in a want-all list
1153 * @bat_priv: the bat priv with all the soft interface information
1154 * @skb: the multicast packet to transmit
1155 * @vid: the vlan identifier
1156 *
1157 * Sends copies of a frame with multicast destination to any node with a
1158 * BATADV_MCAST_WANT_ALL_IPV4 or BATADV_MCAST_WANT_ALL_IPV6 flag set. A
1159 * transmission is performed via a batman-adv unicast packet for each such
1160 * destination node.
1161 *
1162 * Return: NET_XMIT_DROP on memory allocation failure or if the protocol family
1163 * is neither IPv4 nor IPv6. NET_XMIT_SUCCESS otherwise.
1164 */
1165static int
1166batadv_mcast_forw_want_all(struct batadv_priv *bat_priv,
1167 struct sk_buff *skb, unsigned short vid)
1168{
1169 switch (ntohs(eth_hdr(skb)->h_proto)) {
1170 case ETH_P_IP:
1171 return batadv_mcast_forw_want_all_ipv4(bat_priv, skb, vid);
1172 case ETH_P_IPV6:
1173 return batadv_mcast_forw_want_all_ipv6(bat_priv, skb, vid);
1174 default:
1175 /* we shouldn't be here... */
1176 return NET_XMIT_DROP;
1177 }
1178}
1179
1180/**
1181 * batadv_mcast_forw_send() - send packet to any detected multicast recpient
1182 * @bat_priv: the bat priv with all the soft interface information
1183 * @skb: the multicast packet to transmit
1184 * @vid: the vlan identifier
1185 *
1186 * Sends copies of a frame with multicast destination to any node that signaled
1187 * interest in it, that is either via the translation table or the according
1188 * want-all flags. A transmission is performed via a batman-adv unicast packet
1189 * for each such destination node.
1190 *
1191 * The given skb is consumed/freed.
1192 *
1193 * Return: NET_XMIT_DROP on memory allocation failure or if the protocol family
1194 * is neither IPv4 nor IPv6. NET_XMIT_SUCCESS otherwise.
1195 */
1196int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
1197 unsigned short vid)
1198{
1199 int ret;
1200
1201 ret = batadv_mcast_forw_tt(bat_priv, skb, vid);
1202 if (ret != NET_XMIT_SUCCESS) {
1203 kfree_skb(skb);
1204 return ret;
1205 }
1206
1207 ret = batadv_mcast_forw_want_all(bat_priv, skb, vid);
1208 if (ret != NET_XMIT_SUCCESS) {
1209 kfree_skb(skb);
1210 return ret;
1211 }
1212
1213 consume_skb(skb);
1214 return ret;
1030} 1215}
1031 1216
1032/** 1217/**
diff --git a/net/batman-adv/multicast.h b/net/batman-adv/multicast.h
index 466013fe88af..653b9b76fabe 100644
--- a/net/batman-adv/multicast.h
+++ b/net/batman-adv/multicast.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2014-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2014-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Linus Lüssing 4 * Linus Lüssing
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#ifndef _NET_BATMAN_ADV_MULTICAST_H_ 7#ifndef _NET_BATMAN_ADV_MULTICAST_H_
@@ -36,6 +24,13 @@ enum batadv_forw_mode {
36 BATADV_FORW_ALL, 24 BATADV_FORW_ALL,
37 25
38 /** 26 /**
27 * @BATADV_FORW_SOME: forward the packet to some nodes (currently via
28 * a multicast-to-unicast conversion and the BATMAN unicast routing
29 * protocol)
30 */
31 BATADV_FORW_SOME,
32
33 /**
39 * @BATADV_FORW_SINGLE: forward the packet to a single node (currently 34 * @BATADV_FORW_SINGLE: forward the packet to a single node (currently
40 * via the BATMAN unicast routing protocol) 35 * via the BATMAN unicast routing protocol)
41 */ 36 */
@@ -51,6 +46,9 @@ enum batadv_forw_mode
51batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb, 46batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
52 struct batadv_orig_node **mcast_single_orig); 47 struct batadv_orig_node **mcast_single_orig);
53 48
49int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
50 unsigned short vid);
51
54void batadv_mcast_init(struct batadv_priv *bat_priv); 52void batadv_mcast_init(struct batadv_priv *bat_priv);
55 53
56int batadv_mcast_flags_seq_print_text(struct seq_file *seq, void *offset); 54int batadv_mcast_flags_seq_print_text(struct seq_file *seq, void *offset);
@@ -73,6 +71,14 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
73 return BATADV_FORW_ALL; 71 return BATADV_FORW_ALL;
74} 72}
75 73
74static inline int
75batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
76 unsigned short vid)
77{
78 kfree_skb(skb);
79 return NET_XMIT_DROP;
80}
81
76static inline int batadv_mcast_init(struct batadv_priv *bat_priv) 82static inline int batadv_mcast_init(struct batadv_priv *bat_priv)
77{ 83{
78 return 0; 84 return 0;
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index d3033a3d2a63..e7907308b331 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Matthias Schiffer 4 * Matthias Schiffer
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#include "netlink.h" 7#include "netlink.h"
@@ -157,6 +145,7 @@ static const struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = {
157 [BATADV_ATTR_HOP_PENALTY] = { .type = NLA_U8 }, 145 [BATADV_ATTR_HOP_PENALTY] = { .type = NLA_U8 },
158 [BATADV_ATTR_LOG_LEVEL] = { .type = NLA_U32 }, 146 [BATADV_ATTR_LOG_LEVEL] = { .type = NLA_U32 },
159 [BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED] = { .type = NLA_U8 }, 147 [BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED] = { .type = NLA_U8 },
148 [BATADV_ATTR_MULTICAST_FANOUT] = { .type = NLA_U32 },
160 [BATADV_ATTR_NETWORK_CODING_ENABLED] = { .type = NLA_U8 }, 149 [BATADV_ATTR_NETWORK_CODING_ENABLED] = { .type = NLA_U8 },
161 [BATADV_ATTR_ORIG_INTERVAL] = { .type = NLA_U32 }, 150 [BATADV_ATTR_ORIG_INTERVAL] = { .type = NLA_U32 },
162 [BATADV_ATTR_ELP_INTERVAL] = { .type = NLA_U32 }, 151 [BATADV_ATTR_ELP_INTERVAL] = { .type = NLA_U32 },
@@ -353,6 +342,10 @@ static int batadv_netlink_mesh_fill(struct sk_buff *msg,
353 if (nla_put_u8(msg, BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED, 342 if (nla_put_u8(msg, BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED,
354 !atomic_read(&bat_priv->multicast_mode))) 343 !atomic_read(&bat_priv->multicast_mode)))
355 goto nla_put_failure; 344 goto nla_put_failure;
345
346 if (nla_put_u32(msg, BATADV_ATTR_MULTICAST_FANOUT,
347 atomic_read(&bat_priv->multicast_fanout)))
348 goto nla_put_failure;
356#endif /* CONFIG_BATMAN_ADV_MCAST */ 349#endif /* CONFIG_BATMAN_ADV_MCAST */
357 350
358#ifdef CONFIG_BATMAN_ADV_NC 351#ifdef CONFIG_BATMAN_ADV_NC
@@ -592,6 +585,12 @@ static int batadv_netlink_set_mesh(struct sk_buff *skb, struct genl_info *info)
592 585
593 atomic_set(&bat_priv->multicast_mode, !nla_get_u8(attr)); 586 atomic_set(&bat_priv->multicast_mode, !nla_get_u8(attr));
594 } 587 }
588
589 if (info->attrs[BATADV_ATTR_MULTICAST_FANOUT]) {
590 attr = info->attrs[BATADV_ATTR_MULTICAST_FANOUT];
591
592 atomic_set(&bat_priv->multicast_fanout, nla_get_u32(attr));
593 }
595#endif /* CONFIG_BATMAN_ADV_MCAST */ 594#endif /* CONFIG_BATMAN_ADV_MCAST */
596 595
597#ifdef CONFIG_BATMAN_ADV_NC 596#ifdef CONFIG_BATMAN_ADV_NC
diff --git a/net/batman-adv/netlink.h b/net/batman-adv/netlink.h
index 7273368544fc..d1e0681b8743 100644
--- a/net/batman-adv/netlink.h
+++ b/net/batman-adv/netlink.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Matthias Schiffer 4 * Matthias Schiffer
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#ifndef _NET_BATMAN_ADV_NETLINK_H_ 7#ifndef _NET_BATMAN_ADV_NETLINK_H_
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c
index 278762bd94c6..c5e7906045f3 100644
--- a/net/batman-adv/network-coding.c
+++ b/net/batman-adv/network-coding.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Martin Hundebøll, Jeppe Ledet-Pedersen 4 * Martin Hundebøll, Jeppe Ledet-Pedersen
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#include "network-coding.h" 7#include "network-coding.h"
diff --git a/net/batman-adv/network-coding.h b/net/batman-adv/network-coding.h
index 96ef0a511fc7..74f56113a5d0 100644
--- a/net/batman-adv/network-coding.h
+++ b/net/batman-adv/network-coding.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Martin Hundebøll, Jeppe Ledet-Pedersen 4 * Martin Hundebøll, Jeppe Ledet-Pedersen
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#ifndef _NET_BATMAN_ADV_NETWORK_CODING_H_ 7#ifndef _NET_BATMAN_ADV_NETWORK_CODING_H_
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index e5cdf89ef63c..45db798a7297 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#include "originator.h" 7#include "originator.h"
diff --git a/net/batman-adv/originator.h b/net/batman-adv/originator.h
index dca1e4a34ec6..3829e26f9c5d 100644
--- a/net/batman-adv/originator.h
+++ b/net/batman-adv/originator.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _NET_BATMAN_ADV_ORIGINATOR_H_ 7#ifndef _NET_BATMAN_ADV_ORIGINATOR_H_
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index cae0e5dd0768..f0f864820dea 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#include "routing.h" 7#include "routing.h"
diff --git a/net/batman-adv/routing.h b/net/batman-adv/routing.h
index 0102d69d345c..b96c6d06d188 100644
--- a/net/batman-adv/routing.h
+++ b/net/batman-adv/routing.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _NET_BATMAN_ADV_ROUTING_H_ 7#ifndef _NET_BATMAN_ADV_ROUTING_H_
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 66a8b3e44501..3ce5f7bad369 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#include "send.h" 7#include "send.h"
diff --git a/net/batman-adv/send.h b/net/batman-adv/send.h
index 1f6132922e60..5921ee4e107c 100644
--- a/net/batman-adv/send.h
+++ b/net/batman-adv/send.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _NET_BATMAN_ADV_SEND_H_ 7#ifndef _NET_BATMAN_ADV_SEND_H_
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 2e367230376b..a7677e1d000f 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#include "soft-interface.h" 7#include "soft-interface.h"
@@ -209,7 +197,7 @@ static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
209 unsigned short vid; 197 unsigned short vid;
210 u32 seqno; 198 u32 seqno;
211 int gw_mode; 199 int gw_mode;
212 enum batadv_forw_mode forw_mode; 200 enum batadv_forw_mode forw_mode = BATADV_FORW_SINGLE;
213 struct batadv_orig_node *mcast_single_orig = NULL; 201 struct batadv_orig_node *mcast_single_orig = NULL;
214 int network_offset = ETH_HLEN; 202 int network_offset = ETH_HLEN;
215 __be16 proto; 203 __be16 proto;
@@ -317,7 +305,8 @@ send:
317 if (forw_mode == BATADV_FORW_NONE) 305 if (forw_mode == BATADV_FORW_NONE)
318 goto dropped; 306 goto dropped;
319 307
320 if (forw_mode == BATADV_FORW_SINGLE) 308 if (forw_mode == BATADV_FORW_SINGLE ||
309 forw_mode == BATADV_FORW_SOME)
321 do_bcast = false; 310 do_bcast = false;
322 } 311 }
323 } 312 }
@@ -377,6 +366,8 @@ send:
377 ret = batadv_send_skb_unicast(bat_priv, skb, 366 ret = batadv_send_skb_unicast(bat_priv, skb,
378 BATADV_UNICAST, 0, 367 BATADV_UNICAST, 0,
379 mcast_single_orig, vid); 368 mcast_single_orig, vid);
369 } else if (forw_mode == BATADV_FORW_SOME) {
370 ret = batadv_mcast_forw_send(bat_priv, skb, vid);
380 } else { 371 } else {
381 if (batadv_dat_snoop_outgoing_arp_request(bat_priv, 372 if (batadv_dat_snoop_outgoing_arp_request(bat_priv,
382 skb)) 373 skb))
@@ -818,6 +809,7 @@ static int batadv_softif_init_late(struct net_device *dev)
818 bat_priv->mcast.querier_ipv6.shadowing = false; 809 bat_priv->mcast.querier_ipv6.shadowing = false;
819 bat_priv->mcast.flags = BATADV_NO_FLAGS; 810 bat_priv->mcast.flags = BATADV_NO_FLAGS;
820 atomic_set(&bat_priv->multicast_mode, 1); 811 atomic_set(&bat_priv->multicast_mode, 1);
812 atomic_set(&bat_priv->multicast_fanout, 16);
821 atomic_set(&bat_priv->mcast.num_want_all_unsnoopables, 0); 813 atomic_set(&bat_priv->mcast.num_want_all_unsnoopables, 0);
822 atomic_set(&bat_priv->mcast.num_want_all_ipv4, 0); 814 atomic_set(&bat_priv->mcast.num_want_all_ipv4, 0);
823 atomic_set(&bat_priv->mcast.num_want_all_ipv6, 0); 815 atomic_set(&bat_priv->mcast.num_want_all_ipv6, 0);
diff --git a/net/batman-adv/soft-interface.h b/net/batman-adv/soft-interface.h
index 538bb661878c..275442a7acb6 100644
--- a/net/batman-adv/soft-interface.h
+++ b/net/batman-adv/soft-interface.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_ 7#ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c
index 0b4b3fb778a6..ad14c8086fe7 100644
--- a/net/batman-adv/sysfs.c
+++ b/net/batman-adv/sysfs.c
@@ -2,23 +2,12 @@
2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#include "sysfs.h" 7#include "sysfs.h"
20#include "main.h" 8#include "main.h"
21 9
10#include <asm/current.h>
22#include <linux/atomic.h> 11#include <linux/atomic.h>
23#include <linux/compiler.h> 12#include <linux/compiler.h>
24#include <linux/device.h> 13#include <linux/device.h>
@@ -34,6 +23,7 @@
34#include <linux/rculist.h> 23#include <linux/rculist.h>
35#include <linux/rcupdate.h> 24#include <linux/rcupdate.h>
36#include <linux/rtnetlink.h> 25#include <linux/rtnetlink.h>
26#include <linux/sched.h>
37#include <linux/slab.h> 27#include <linux/slab.h>
38#include <linux/stddef.h> 28#include <linux/stddef.h>
39#include <linux/string.h> 29#include <linux/string.h>
@@ -52,6 +42,16 @@
52#include "network-coding.h" 42#include "network-coding.h"
53#include "soft-interface.h" 43#include "soft-interface.h"
54 44
45/**
46 * batadv_sysfs_deprecated() - Log use of deprecated batadv sysfs access
47 * @attr: attribute which was accessed
48 */
49static void batadv_sysfs_deprecated(struct attribute *attr)
50{
51 pr_warn_ratelimited(DEPRECATED "%s (pid %d) Use of sysfs file \"%s\".\nUse batadv genl family instead",
52 current->comm, task_pid_nr(current), attr->name);
53}
54
55static struct net_device *batadv_kobj_to_netdev(struct kobject *obj) 55static struct net_device *batadv_kobj_to_netdev(struct kobject *obj)
56{ 56{
57 struct device *dev = container_of(obj->parent, struct device, kobj); 57 struct device *dev = container_of(obj->parent, struct device, kobj);
@@ -114,22 +114,6 @@ batadv_kobj_to_vlan(struct batadv_priv *bat_priv, struct kobject *obj)
114 return vlan; 114 return vlan;
115} 115}
116 116
117#define BATADV_UEV_TYPE_VAR "BATTYPE="
118#define BATADV_UEV_ACTION_VAR "BATACTION="
119#define BATADV_UEV_DATA_VAR "BATDATA="
120
121static char *batadv_uev_action_str[] = {
122 "add",
123 "del",
124 "change",
125 "loopdetect",
126};
127
128static char *batadv_uev_type_str[] = {
129 "gw",
130 "bla",
131};
132
133/* Use this, if you have customized show and store functions for vlan attrs */ 117/* Use this, if you have customized show and store functions for vlan attrs */
134#define BATADV_ATTR_VLAN(_name, _mode, _show, _store) \ 118#define BATADV_ATTR_VLAN(_name, _mode, _show, _store) \
135struct batadv_attribute batadv_attr_vlan_##_name = { \ 119struct batadv_attribute batadv_attr_vlan_##_name = { \
@@ -157,6 +141,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \
157 struct batadv_priv *bat_priv = netdev_priv(net_dev); \ 141 struct batadv_priv *bat_priv = netdev_priv(net_dev); \
158 ssize_t length; \ 142 ssize_t length; \
159 \ 143 \
144 batadv_sysfs_deprecated(attr); \
160 length = __batadv_store_bool_attr(buff, count, _post_func, attr,\ 145 length = __batadv_store_bool_attr(buff, count, _post_func, attr,\
161 &bat_priv->_name, net_dev); \ 146 &bat_priv->_name, net_dev); \
162 \ 147 \
@@ -171,6 +156,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \
171{ \ 156{ \
172 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ 157 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \
173 \ 158 \
159 batadv_sysfs_deprecated(attr); \
174 return sprintf(buff, "%s\n", \ 160 return sprintf(buff, "%s\n", \
175 atomic_read(&bat_priv->_name) == 0 ? \ 161 atomic_read(&bat_priv->_name) == 0 ? \
176 "disabled" : "enabled"); \ 162 "disabled" : "enabled"); \
@@ -194,6 +180,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \
194 struct batadv_priv *bat_priv = netdev_priv(net_dev); \ 180 struct batadv_priv *bat_priv = netdev_priv(net_dev); \
195 ssize_t length; \ 181 ssize_t length; \
196 \ 182 \
183 batadv_sysfs_deprecated(attr); \
197 length = __batadv_store_uint_attr(buff, count, _min, _max, \ 184 length = __batadv_store_uint_attr(buff, count, _min, _max, \
198 _post_func, attr, \ 185 _post_func, attr, \
199 &bat_priv->_var, net_dev, \ 186 &bat_priv->_var, net_dev, \
@@ -210,6 +197,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \
210{ \ 197{ \
211 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ 198 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \
212 \ 199 \
200 batadv_sysfs_deprecated(attr); \
213 return sprintf(buff, "%i\n", atomic_read(&bat_priv->_var)); \ 201 return sprintf(buff, "%i\n", atomic_read(&bat_priv->_var)); \
214} \ 202} \
215 203
@@ -234,6 +222,7 @@ ssize_t batadv_store_vlan_##_name(struct kobject *kobj, \
234 attr, &vlan->_name, \ 222 attr, &vlan->_name, \
235 bat_priv->soft_iface); \ 223 bat_priv->soft_iface); \
236 \ 224 \
225 batadv_sysfs_deprecated(attr); \
237 if (vlan->vid) \ 226 if (vlan->vid) \
238 batadv_netlink_notify_vlan(bat_priv, vlan); \ 227 batadv_netlink_notify_vlan(bat_priv, vlan); \
239 else \ 228 else \
@@ -254,6 +243,7 @@ ssize_t batadv_show_vlan_##_name(struct kobject *kobj, \
254 atomic_read(&vlan->_name) == 0 ? \ 243 atomic_read(&vlan->_name) == 0 ? \
255 "disabled" : "enabled"); \ 244 "disabled" : "enabled"); \
256 \ 245 \
246 batadv_sysfs_deprecated(attr); \
257 batadv_softif_vlan_put(vlan); \ 247 batadv_softif_vlan_put(vlan); \
258 return res; \ 248 return res; \
259} 249}
@@ -275,6 +265,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \
275 struct batadv_priv *bat_priv; \ 265 struct batadv_priv *bat_priv; \
276 ssize_t length; \ 266 ssize_t length; \
277 \ 267 \
268 batadv_sysfs_deprecated(attr); \
278 hard_iface = batadv_hardif_get_by_netdev(net_dev); \ 269 hard_iface = batadv_hardif_get_by_netdev(net_dev); \
279 if (!hard_iface) \ 270 if (!hard_iface) \
280 return 0; \ 271 return 0; \
@@ -302,6 +293,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \
302 struct batadv_hard_iface *hard_iface; \ 293 struct batadv_hard_iface *hard_iface; \
303 ssize_t length; \ 294 ssize_t length; \
304 \ 295 \
296 batadv_sysfs_deprecated(attr); \
305 hard_iface = batadv_hardif_get_by_netdev(net_dev); \ 297 hard_iface = batadv_hardif_get_by_netdev(net_dev); \
306 if (!hard_iface) \ 298 if (!hard_iface) \
307 return 0; \ 299 return 0; \
@@ -446,6 +438,7 @@ static ssize_t batadv_show_bat_algo(struct kobject *kobj,
446{ 438{
447 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 439 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj);
448 440
441 batadv_sysfs_deprecated(attr);
449 return sprintf(buff, "%s\n", bat_priv->algo_ops->name); 442 return sprintf(buff, "%s\n", bat_priv->algo_ops->name);
450} 443}
451 444
@@ -462,6 +455,8 @@ static ssize_t batadv_show_gw_mode(struct kobject *kobj, struct attribute *attr,
462 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 455 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj);
463 int bytes_written; 456 int bytes_written;
464 457
458 batadv_sysfs_deprecated(attr);
459
465 /* GW mode is not available if the routing algorithm in use does not 460 /* GW mode is not available if the routing algorithm in use does not
466 * implement the GW API 461 * implement the GW API
467 */ 462 */
@@ -496,6 +491,8 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj,
496 char *curr_gw_mode_str; 491 char *curr_gw_mode_str;
497 int gw_mode_tmp = -1; 492 int gw_mode_tmp = -1;
498 493
494 batadv_sysfs_deprecated(attr);
495
499 /* toggling GW mode is allowed only if the routing algorithm in use 496 /* toggling GW mode is allowed only if the routing algorithm in use
500 * provides the GW API 497 * provides the GW API
501 */ 498 */
@@ -570,6 +567,8 @@ static ssize_t batadv_show_gw_sel_class(struct kobject *kobj,
570{ 567{
571 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 568 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj);
572 569
570 batadv_sysfs_deprecated(attr);
571
573 /* GW selection class is not available if the routing algorithm in use 572 /* GW selection class is not available if the routing algorithm in use
574 * does not implement the GW API 573 * does not implement the GW API
575 */ 574 */
@@ -590,6 +589,8 @@ static ssize_t batadv_store_gw_sel_class(struct kobject *kobj,
590 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 589 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj);
591 ssize_t length; 590 ssize_t length;
592 591
592 batadv_sysfs_deprecated(attr);
593
593 /* setting the GW selection class is allowed only if the routing 594 /* setting the GW selection class is allowed only if the routing
594 * algorithm in use implements the GW API 595 * algorithm in use implements the GW API
595 */ 596 */
@@ -620,6 +621,8 @@ static ssize_t batadv_show_gw_bwidth(struct kobject *kobj,
620 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 621 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj);
621 u32 down, up; 622 u32 down, up;
622 623
624 batadv_sysfs_deprecated(attr);
625
623 down = atomic_read(&bat_priv->gw.bandwidth_down); 626 down = atomic_read(&bat_priv->gw.bandwidth_down);
624 up = atomic_read(&bat_priv->gw.bandwidth_up); 627 up = atomic_read(&bat_priv->gw.bandwidth_up);
625 628
@@ -635,6 +638,8 @@ static ssize_t batadv_store_gw_bwidth(struct kobject *kobj,
635 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); 638 struct net_device *net_dev = batadv_kobj_to_netdev(kobj);
636 ssize_t length; 639 ssize_t length;
637 640
641 batadv_sysfs_deprecated(attr);
642
638 if (buff[count - 1] == '\n') 643 if (buff[count - 1] == '\n')
639 buff[count - 1] = '\0'; 644 buff[count - 1] = '\0';
640 645
@@ -659,6 +664,7 @@ static ssize_t batadv_show_isolation_mark(struct kobject *kobj,
659{ 664{
660 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 665 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj);
661 666
667 batadv_sysfs_deprecated(attr);
662 return sprintf(buff, "%#.8x/%#.8x\n", bat_priv->isolation_mark, 668 return sprintf(buff, "%#.8x/%#.8x\n", bat_priv->isolation_mark,
663 bat_priv->isolation_mark_mask); 669 bat_priv->isolation_mark_mask);
664} 670}
@@ -682,6 +688,8 @@ static ssize_t batadv_store_isolation_mark(struct kobject *kobj,
682 u32 mark, mask; 688 u32 mark, mask;
683 char *mask_ptr; 689 char *mask_ptr;
684 690
691 batadv_sysfs_deprecated(attr);
692
685 /* parse the mask if it has been specified, otherwise assume the mask is 693 /* parse the mask if it has been specified, otherwise assume the mask is
686 * the biggest possible 694 * the biggest possible
687 */ 695 */
@@ -937,6 +945,8 @@ static ssize_t batadv_show_mesh_iface(struct kobject *kobj,
937 ssize_t length; 945 ssize_t length;
938 const char *ifname; 946 const char *ifname;
939 947
948 batadv_sysfs_deprecated(attr);
949
940 hard_iface = batadv_hardif_get_by_netdev(net_dev); 950 hard_iface = batadv_hardif_get_by_netdev(net_dev);
941 if (!hard_iface) 951 if (!hard_iface)
942 return 0; 952 return 0;
@@ -1041,6 +1051,8 @@ static ssize_t batadv_store_mesh_iface(struct kobject *kobj,
1041 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); 1051 struct net_device *net_dev = batadv_kobj_to_netdev(kobj);
1042 struct batadv_store_mesh_work *store_work; 1052 struct batadv_store_mesh_work *store_work;
1043 1053
1054 batadv_sysfs_deprecated(attr);
1055
1044 if (buff[count - 1] == '\n') 1056 if (buff[count - 1] == '\n')
1045 buff[count - 1] = '\0'; 1057 buff[count - 1] = '\0';
1046 1058
@@ -1072,6 +1084,8 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj,
1072 struct batadv_hard_iface *hard_iface; 1084 struct batadv_hard_iface *hard_iface;
1073 ssize_t length; 1085 ssize_t length;
1074 1086
1087 batadv_sysfs_deprecated(attr);
1088
1075 hard_iface = batadv_hardif_get_by_netdev(net_dev); 1089 hard_iface = batadv_hardif_get_by_netdev(net_dev);
1076 if (!hard_iface) 1090 if (!hard_iface)
1077 return 0; 1091 return 0;
@@ -1123,6 +1137,8 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj,
1123 u32 old_tp_override; 1137 u32 old_tp_override;
1124 bool ret; 1138 bool ret;
1125 1139
1140 batadv_sysfs_deprecated(attr);
1141
1126 hard_iface = batadv_hardif_get_by_netdev(net_dev); 1142 hard_iface = batadv_hardif_get_by_netdev(net_dev);
1127 if (!hard_iface) 1143 if (!hard_iface)
1128 return -EINVAL; 1144 return -EINVAL;
@@ -1162,6 +1178,8 @@ static ssize_t batadv_show_throughput_override(struct kobject *kobj,
1162 struct batadv_hard_iface *hard_iface; 1178 struct batadv_hard_iface *hard_iface;
1163 u32 tp_override; 1179 u32 tp_override;
1164 1180
1181 batadv_sysfs_deprecated(attr);
1182
1165 hard_iface = batadv_hardif_get_by_netdev(net_dev); 1183 hard_iface = batadv_hardif_get_by_netdev(net_dev);
1166 if (!hard_iface) 1184 if (!hard_iface)
1167 return -EINVAL; 1185 return -EINVAL;
@@ -1247,57 +1265,3 @@ void batadv_sysfs_del_hardif(struct kobject **hardif_obj)
1247 kobject_put(*hardif_obj); 1265 kobject_put(*hardif_obj);
1248 *hardif_obj = NULL; 1266 *hardif_obj = NULL;
1249} 1267}
1250
1251/**
1252 * batadv_throw_uevent() - Send an uevent with batman-adv specific env data
1253 * @bat_priv: the bat priv with all the soft interface information
1254 * @type: subsystem type of event. Stored in uevent's BATTYPE
1255 * @action: action type of event. Stored in uevent's BATACTION
1256 * @data: string with additional information to the event (ignored for
1257 * BATADV_UEV_DEL). Stored in uevent's BATDATA
1258 *
1259 * Return: 0 on success or negative error number in case of failure
1260 */
1261int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type,
1262 enum batadv_uev_action action, const char *data)
1263{
1264 int ret = -ENOMEM;
1265 struct kobject *bat_kobj;
1266 char *uevent_env[4] = { NULL, NULL, NULL, NULL };
1267
1268 bat_kobj = &bat_priv->soft_iface->dev.kobj;
1269
1270 uevent_env[0] = kasprintf(GFP_ATOMIC,
1271 "%s%s", BATADV_UEV_TYPE_VAR,
1272 batadv_uev_type_str[type]);
1273 if (!uevent_env[0])
1274 goto out;
1275
1276 uevent_env[1] = kasprintf(GFP_ATOMIC,
1277 "%s%s", BATADV_UEV_ACTION_VAR,
1278 batadv_uev_action_str[action]);
1279 if (!uevent_env[1])
1280 goto out;
1281
1282 /* If the event is DEL, ignore the data field */
1283 if (action != BATADV_UEV_DEL) {
1284 uevent_env[2] = kasprintf(GFP_ATOMIC,
1285 "%s%s", BATADV_UEV_DATA_VAR, data);
1286 if (!uevent_env[2])
1287 goto out;
1288 }
1289
1290 ret = kobject_uevent_env(bat_kobj, KOBJ_CHANGE, uevent_env);
1291out:
1292 kfree(uevent_env[0]);
1293 kfree(uevent_env[1]);
1294 kfree(uevent_env[2]);
1295
1296 if (ret)
1297 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1298 "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",
1299 batadv_uev_type_str[type],
1300 batadv_uev_action_str[action],
1301 (action == BATADV_UEV_DEL ? "NULL" : data), ret);
1302 return ret;
1303}
diff --git a/net/batman-adv/sysfs.h b/net/batman-adv/sysfs.h
index 705ffbe763f4..83fa808b1871 100644
--- a/net/batman-adv/sysfs.h
+++ b/net/batman-adv/sysfs.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner 4 * Marek Lindner
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#ifndef _NET_BATMAN_ADV_SYSFS_H_ 7#ifndef _NET_BATMAN_ADV_SYSFS_H_
@@ -57,6 +45,8 @@ struct batadv_attribute {
57 char *buf, size_t count); 45 char *buf, size_t count);
58}; 46};
59 47
48#ifdef CONFIG_BATMAN_ADV_SYSFS
49
60int batadv_sysfs_add_meshif(struct net_device *dev); 50int batadv_sysfs_add_meshif(struct net_device *dev);
61void batadv_sysfs_del_meshif(struct net_device *dev); 51void batadv_sysfs_del_meshif(struct net_device *dev);
62int batadv_sysfs_add_hardif(struct kobject **hardif_obj, 52int batadv_sysfs_add_hardif(struct kobject **hardif_obj,
@@ -66,7 +56,39 @@ int batadv_sysfs_add_vlan(struct net_device *dev,
66 struct batadv_softif_vlan *vlan); 56 struct batadv_softif_vlan *vlan);
67void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv, 57void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv,
68 struct batadv_softif_vlan *vlan); 58 struct batadv_softif_vlan *vlan);
69int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, 59
70 enum batadv_uev_action action, const char *data); 60#else
61
62static inline int batadv_sysfs_add_meshif(struct net_device *dev)
63{
64 return 0;
65}
66
67static inline void batadv_sysfs_del_meshif(struct net_device *dev)
68{
69}
70
71static inline int batadv_sysfs_add_hardif(struct kobject **hardif_obj,
72 struct net_device *dev)
73{
74 return 0;
75}
76
77static inline void batadv_sysfs_del_hardif(struct kobject **hardif_obj)
78{
79}
80
81static inline int batadv_sysfs_add_vlan(struct net_device *dev,
82 struct batadv_softif_vlan *vlan)
83{
84 return 0;
85}
86
87static inline void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv,
88 struct batadv_softif_vlan *vlan)
89{
90}
91
92#endif
71 93
72#endif /* _NET_BATMAN_ADV_SYSFS_H_ */ 94#endif /* _NET_BATMAN_ADV_SYSFS_H_ */
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index 500109bbd551..820392146249 100644
--- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Edo Monticelli, Antonio Quartulli 4 * Edo Monticelli, Antonio Quartulli
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#include "tp_meter.h" 7#include "tp_meter.h"
diff --git a/net/batman-adv/tp_meter.h b/net/batman-adv/tp_meter.h
index 6b4d0f733896..604b3799c972 100644
--- a/net/batman-adv/tp_meter.h
+++ b/net/batman-adv/tp_meter.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Edo Monticelli, Antonio Quartulli 4 * Edo Monticelli, Antonio Quartulli
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#ifndef _NET_BATMAN_ADV_TP_METER_H_ 7#ifndef _NET_BATMAN_ADV_TP_METER_H_
diff --git a/net/batman-adv/trace.c b/net/batman-adv/trace.c
index f77c917ed20d..3cedd2c36528 100644
--- a/net/batman-adv/trace.c
+++ b/net/batman-adv/trace.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Sven Eckelmann 4 * Sven Eckelmann
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#define CREATE_TRACE_POINTS 7#define CREATE_TRACE_POINTS
diff --git a/net/batman-adv/trace.h b/net/batman-adv/trace.h
index 5e5579051400..d8f764521c0b 100644
--- a/net/batman-adv/trace.h
+++ b/net/batman-adv/trace.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Sven Eckelmann 4 * Sven Eckelmann
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#if !defined(_NET_BATMAN_ADV_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) 7#if !defined(_NET_BATMAN_ADV_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index f73d79139ae7..5d8bf8048e4e 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich, Antonio Quartulli 4 * Marek Lindner, Simon Wunderlich, Antonio Quartulli
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#include "translation-table.h" 7#include "translation-table.h"
@@ -205,7 +193,7 @@ batadv_tt_local_hash_find(struct batadv_priv *bat_priv, const u8 *addr,
205 * Return: a pointer to the corresponding tt_global_entry struct if the client 193 * Return: a pointer to the corresponding tt_global_entry struct if the client
206 * is found, NULL otherwise. 194 * is found, NULL otherwise.
207 */ 195 */
208static struct batadv_tt_global_entry * 196struct batadv_tt_global_entry *
209batadv_tt_global_hash_find(struct batadv_priv *bat_priv, const u8 *addr, 197batadv_tt_global_hash_find(struct batadv_priv *bat_priv, const u8 *addr,
210 unsigned short vid) 198 unsigned short vid)
211{ 199{
@@ -300,8 +288,7 @@ static void batadv_tt_global_entry_release(struct kref *ref)
300 * possibly release it 288 * possibly release it
301 * @tt_global_entry: tt_global_entry to be free'd 289 * @tt_global_entry: tt_global_entry to be free'd
302 */ 290 */
303static void 291void batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry)
304batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry)
305{ 292{
306 kref_put(&tt_global_entry->common.refcount, 293 kref_put(&tt_global_entry->common.refcount,
307 batadv_tt_global_entry_release); 294 batadv_tt_global_entry_release);
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h
index 61bca75e5911..c8c48d62a430 100644
--- a/net/batman-adv/translation-table.h
+++ b/net/batman-adv/translation-table.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich, Antonio Quartulli 4 * Marek Lindner, Simon Wunderlich, Antonio Quartulli
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#ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ 7#ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
@@ -41,6 +29,10 @@ int batadv_tt_global_dump(struct sk_buff *msg, struct netlink_callback *cb);
41void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, 29void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
42 struct batadv_orig_node *orig_node, 30 struct batadv_orig_node *orig_node,
43 s32 match_vid, const char *message); 31 s32 match_vid, const char *message);
32struct batadv_tt_global_entry *
33batadv_tt_global_hash_find(struct batadv_priv *bat_priv, const u8 *addr,
34 unsigned short vid);
35void batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry);
44int batadv_tt_global_hash_count(struct batadv_priv *bat_priv, 36int batadv_tt_global_hash_count(struct batadv_priv *bat_priv,
45 const u8 *addr, unsigned short vid); 37 const u8 *addr, unsigned short vid);
46struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv, 38struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv,
diff --git a/net/batman-adv/tvlv.c b/net/batman-adv/tvlv.c
index 7e947b01919d..aae63f0d21eb 100644
--- a/net/batman-adv/tvlv.c
+++ b/net/batman-adv/tvlv.c
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#include "main.h" 7#include "main.h"
diff --git a/net/batman-adv/tvlv.h b/net/batman-adv/tvlv.h
index c0f033b1acb8..114ac01e06af 100644
--- a/net/batman-adv/tvlv.h
+++ b/net/batman-adv/tvlv.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _NET_BATMAN_ADV_TVLV_H_ 7#ifndef _NET_BATMAN_ADV_TVLV_H_
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index a21b34ed6548..357ca119329a 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -2,18 +2,6 @@
2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 2/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 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#ifndef _NET_BATMAN_ADV_TYPES_H_ 7#ifndef _NET_BATMAN_ADV_TYPES_H_
@@ -1565,6 +1553,12 @@ struct batadv_priv {
1565 * node's sender/originating side 1553 * node's sender/originating side
1566 */ 1554 */
1567 atomic_t multicast_mode; 1555 atomic_t multicast_mode;
1556
1557 /**
1558 * @multicast_fanout: Maximum number of packet copies to generate for a
1559 * multicast-to-unicast conversion
1560 */
1561 atomic_t multicast_fanout;
1568#endif 1562#endif
1569 1563
1570 /** @orig_interval: OGM broadcast interval in milliseconds */ 1564 /** @orig_interval: OGM broadcast interval in milliseconds */