Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+474 -937
+2
Documentation/ABI/testing/sysfs-class-net-batman-adv Documentation/ABI/obsolete/sysfs-class-net-batman-adv
··· 1 + This ABI is deprecated and will be removed after 2021. It is 2 + replaced with the batadv generic netlink family. 1 3 2 4 What: /sys/class/net/<iface>/batman-adv/elp_interval 3 5 Date: Feb 2014
+2
Documentation/ABI/testing/sysfs-class-net-mesh Documentation/ABI/obsolete/sysfs-class-net-mesh
··· 1 + This ABI is deprecated and will be removed after 2021. It is 2 + replaced with the batadv generic netlink family. 1 3 2 4 What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms 3 5 Date: May 2010
+26 -80
Documentation/networking/batman-adv.rst
··· 27 27 $ insmod batman-adv.ko 28 28 29 29 The module is now waiting for activation. You must add some interfaces on which 30 - batman can operate. After loading the module batman advanced will scan your 31 - systems interfaces to search for compatible interfaces. Once found, it will 32 - create subfolders in the ``/sys`` directories of each supported interface, 33 - e.g.:: 34 - 35 - $ ls /sys/class/net/eth0/batman_adv/ 36 - elp_interval iface_status mesh_iface throughput_override 37 - 38 - If an interface does not have the ``batman_adv`` subfolder, it probably is not 39 - supported. Not supported interfaces are: loopback, non-ethernet and batman's 40 - own interfaces. 41 - 42 - Note: After the module was loaded it will continuously watch for new 43 - interfaces to verify the compatibility. There is no need to reload the module 44 - if you plug your USB wifi adapter into your machine after batman advanced was 45 - initially loaded. 46 - 47 - The batman-adv soft-interface can be created using the iproute2 tool ``ip``:: 30 + batman-adv can operate. The batman-adv soft-interface can be created using the 31 + iproute2 tool ``ip``:: 48 32 49 33 $ ip link add name bat0 type batadv 50 34 ··· 36 52 37 53 $ ip link set dev eth0 master bat0 38 54 39 - Repeat this step for all interfaces you wish to add. Now batman starts 55 + Repeat this step for all interfaces you wish to add. Now batman-adv starts 40 56 using/broadcasting on this/these interface(s). 41 - 42 - By reading the "iface_status" file you can check its status:: 43 - 44 - $ cat /sys/class/net/eth0/batman_adv/iface_status 45 - active 46 57 47 58 To deactivate an interface you have to detach it from the "bat0" interface:: 48 59 49 60 $ ip link set dev eth0 nomaster 50 61 62 + The same can also be done using the batctl interface subcommand:: 51 63 52 - All mesh wide settings can be found in batman's own interface folder:: 64 + batctl -m bat0 interface create 65 + batctl -m bat0 interface add -M eth0 53 66 54 - $ ls /sys/class/net/bat0/mesh/ 55 - aggregated_ogms fragmentation isolation_mark routing_algo 56 - ap_isolation gw_bandwidth log_level vlan0 57 - bonding gw_mode multicast_mode 58 - bridge_loop_avoidance gw_sel_class network_coding 59 - distributed_arp_table hop_penalty orig_interval 67 + To detach eth0 and destroy bat0:: 60 68 61 - There is a special folder for debugging information:: 69 + batctl -m bat0 interface del -M eth0 70 + batctl -m bat0 interface destroy 62 71 63 - $ ls /sys/kernel/debug/batman_adv/bat0/ 64 - bla_backbone_table log neighbors transtable_local 65 - bla_claim_table mcast_flags originators 66 - dat_cache nc socket 67 - gateways nc_nodes transtable_global 72 + There are additional settings for each batadv mesh interface, vlan and hardif 73 + which can be modified using batctl. Detailed information about this can be found 74 + in its manual. 68 75 69 - Some of the files contain all sort of status information regarding the mesh 70 - network. For example, you can view the table of originators (mesh 71 - participants) with:: 76 + For instance, you can check the current originator interval (value 77 + in milliseconds which determines how often batman-adv sends its broadcast 78 + packets):: 72 79 73 - $ cat /sys/kernel/debug/batman_adv/bat0/originators 74 - 75 - Other files allow to change batman's behaviour to better fit your requirements. 76 - For instance, you can check the current originator interval (value in 77 - milliseconds which determines how often batman sends its broadcast packets):: 78 - 79 - $ cat /sys/class/net/bat0/mesh/orig_interval 80 + $ batctl -M bat0 orig_interval 80 81 1000 81 82 82 83 and also change its value:: 83 84 84 - $ echo 3000 > /sys/class/net/bat0/mesh/orig_interval 85 + $ batctl -M bat0 orig_interval 3000 85 86 86 87 In very mobile scenarios, you might want to adjust the originator interval to a 87 88 lower value. This will make the mesh more responsive to topology changes, but 88 89 will also increase the overhead. 90 + 91 + Information about the current state can be accessed via the batadv generic 92 + netlink family. batctl provides human readable version via its debug tables 93 + subcommands. 89 94 90 95 91 96 Usage ··· 120 147 menuconfig" and enable the option ``B.A.T.M.A.N. debugging`` 121 148 (``CONFIG_BATMAN_ADV_DEBUG=y``). 122 149 123 - Those additional debug messages can be accessed using a special file in 124 - debugfs:: 150 + Those additional debug messages can be accessed using the perf infrastructure:: 125 151 126 - $ cat /sys/kernel/debug/batman_adv/bat0/log 152 + $ trace-cmd stream -e batadv:batadv_dbg 127 153 128 154 The additional debug output is by default disabled. It can be enabled during 129 - run time. Following log_levels are defined: 155 + run time:: 130 156 131 - .. flat-table:: 157 + $ batctl -m bat0 loglevel routes tt 132 158 133 - * - 0 134 - - All debug output disabled 135 - * - 1 136 - - Enable messages related to routing / flooding / broadcasting 137 - * - 2 138 - - Enable messages related to route added / changed / deleted 139 - * - 4 140 - - Enable messages related to translation table operations 141 - * - 8 142 - - Enable messages related to bridge loop avoidance 143 - * - 16 144 - - Enable messages related to DAT, ARP snooping and parsing 145 - * - 32 146 - - Enable messages related to network coding 147 - * - 64 148 - - Enable messages related to multicast 149 - * - 128 150 - - Enable messages related to throughput meter 151 - * - 255 152 - - Enable all messages 153 - 154 - The debug output can be changed at runtime using the file 155 - ``/sys/class/net/bat0/mesh/log_level``. e.g.:: 156 - 157 - $ echo 6 > /sys/class/net/bat0/mesh/log_level 158 - 159 - will enable debug messages for when routes change. 159 + will enable debug messages for when routes and translation table entries change. 160 160 161 161 Counters for different types of packets entering and leaving the batman-adv 162 162 module are available through ethtool::
+5 -2
MAINTAINERS
··· 2793 2793 M: Antonio Quartulli <a@unstable.cc> 2794 2794 L: b.a.t.m.a.n@lists.open-mesh.org (moderated for non-subscribers) 2795 2795 W: https://www.open-mesh.org/ 2796 + B: https://www.open-mesh.org/projects/batman-adv/issues 2797 + C: irc://chat.freenode.net/batman 2796 2798 Q: https://patchwork.open-mesh.org/project/batman/list/ 2799 + T: git https://git.open-mesh.org/linux-merge.git 2797 2800 S: Maintained 2798 - F: Documentation/ABI/testing/sysfs-class-net-batman-adv 2799 - F: Documentation/ABI/testing/sysfs-class-net-mesh 2801 + F: Documentation/ABI/obsolete/sysfs-class-net-batman-adv 2802 + F: Documentation/ABI/obsolete/sysfs-class-net-mesh 2800 2803 F: Documentation/networking/batman-adv.rst 2801 2804 F: include/uapi/linux/batadv_packet.h 2802 2805 F: include/uapi/linux/batman_adv.h
-12
include/uapi/linux/batadv_packet.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _UAPI_LINUX_BATADV_PACKET_H_
+7 -18
include/uapi/linux/batman_adv.h
··· 2 2 /* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _UAPI_LINUX_BATMAN_ADV_H_ ··· 472 490 * estimate the throughput by itself. 473 491 */ 474 492 BATADV_ATTR_THROUGHPUT_OVERRIDE, 493 + 494 + /** 495 + * @BATADV_ATTR_MULTICAST_FANOUT: defines the maximum number of packet 496 + * copies that may be generated for a multicast-to-unicast conversion. 497 + * Once this limit is exceeded distribution will fall back to broadcast. 498 + */ 499 + BATADV_ATTR_MULTICAST_FANOUT, 475 500 476 501 /* add attributes above here, update the policy in netlink.c */ 477 502
+12 -12
net/batman-adv/Kconfig
··· 2 2 # Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 # 4 4 # Marek Lindner, Simon Wunderlich 5 - # 6 - # This program is free software; you can redistribute it and/or 7 - # modify it under the terms of version 2 of the GNU General Public 8 - # License as published by the Free Software Foundation. 9 - # 10 - # This program is distributed in the hope that it will be useful, but 11 - # WITHOUT ANY WARRANTY; without even the implied warranty of 12 - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - # General Public License for more details. 14 - # 15 - # You should have received a copy of the GNU General Public License 16 - # along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 18 6 # 19 7 # B.A.T.M.A.N meshing protocol ··· 96 108 outputting debugging information to the debugfs log or tracing 97 109 buffer. The output is controlled via the batadv netdev specific 98 110 log_level setting. 111 + 112 + config BATMAN_ADV_SYSFS 113 + bool "batman-adv sysfs entries" 114 + depends on BATMAN_ADV 115 + default y 116 + help 117 + Say Y here if you want to enable batman-adv device configuration and 118 + status interface through sysfs attributes. It is replaced by the 119 + batadv generic netlink family but still used by various userspace 120 + tools and scripts. 121 + 122 + If unsure, say Y. 99 123 100 124 config BATMAN_ADV_TRACING 101 125 bool "B.A.T.M.A.N. tracing support"
+1 -14
net/batman-adv/Makefile
··· 2 2 # Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 # 4 4 # Marek Lindner, Simon Wunderlich 5 - # 6 - # This program is free software; you can redistribute it and/or 7 - # modify it under the terms of version 2 of the GNU General Public 8 - # License as published by the Free Software Foundation. 9 - # 10 - # This program is distributed in the hope that it will be useful, but 11 - # WITHOUT ANY WARRANTY; without even the implied warranty of 12 - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - # General Public License for more details. 14 - # 15 - # You should have received a copy of the GNU General Public License 16 - # along with this program; if not, see <http://www.gnu.org/licenses/>. 17 - # 18 5 19 6 obj-$(CONFIG_BATMAN_ADV) += batman-adv.o 20 7 batman-adv-y += bat_algo.o ··· 28 41 batman-adv-y += routing.o 29 42 batman-adv-y += send.o 30 43 batman-adv-y += soft-interface.o 31 - batman-adv-y += sysfs.o 44 + batman-adv-$(CONFIG_BATMAN_ADV_SYSFS) += sysfs.o 32 45 batman-adv-$(CONFIG_BATMAN_ADV_TRACING) += trace.o 33 46 batman-adv-y += tp_meter.o 34 47 batman-adv-y += translation-table.o
-12
net/batman-adv/bat_algo.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #include "main.h"
-12
net/batman-adv/bat_algo.h
··· 2 2 /* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_BAT_ALGO_H_
-12
net/batman-adv/bat_iv_ogm.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #include "bat_iv_ogm.h"
-12
net/batman-adv/bat_iv_ogm.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _NET_BATMAN_ADV_BAT_IV_OGM_H_
-12
net/batman-adv/bat_v.c
··· 2 2 /* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "bat_v.h"
-12
net/batman-adv/bat_v.h
··· 2 2 /* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_BAT_V_H_
-12
net/batman-adv/bat_v_elp.c
··· 2 2 /* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "bat_v_elp.h"
-12
net/batman-adv/bat_v_elp.h
··· 2 2 /* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_BAT_V_ELP_H_
-12
net/batman-adv/bat_v_ogm.c
··· 2 2 /* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "bat_v_ogm.h"
-12
net/batman-adv/bat_v_ogm.h
··· 2 2 /* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_BAT_V_OGM_H_
-12
net/batman-adv/bitarray.c
··· 2 2 /* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "bitarray.h"
-12
net/batman-adv/bitarray.h
··· 2 2 /* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_BITARRAY_H_
-13
net/batman-adv/bridge_loop_avoidance.c
··· 2 2 /* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "bridge_loop_avoidance.h" ··· 47 59 #include "netlink.h" 48 60 #include "originator.h" 49 61 #include "soft-interface.h" 50 - #include "sysfs.h" 51 62 #include "translation-table.h" 52 63 53 64 static const u8 batadv_announce_mac[4] = {0x43, 0x05, 0x43, 0x05};
-12
net/batman-adv/bridge_loop_avoidance.h
··· 2 2 /* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_BLA_H_
-12
net/batman-adv/debugfs.c
··· 2 2 /* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "debugfs.h"
-12
net/batman-adv/debugfs.h
··· 2 2 /* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_DEBUGFS_H_
+17 -23
net/batman-adv/distributed-arp-table.c
··· 2 2 /* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "distributed-arp-table.h" ··· 655 667 } 656 668 657 669 /** 658 - * batadv_dat_send_data() - send a payload to the selected candidates 670 + * batadv_dat_forward_data() - copy and send payload to the selected candidates 659 671 * @bat_priv: the bat priv with all the soft interface information 660 672 * @skb: payload to send 661 673 * @ip: the DHT key ··· 668 680 * Return: true if the packet is sent to at least one candidate, false 669 681 * otherwise. 670 682 */ 671 - static bool batadv_dat_send_data(struct batadv_priv *bat_priv, 672 - struct sk_buff *skb, __be32 ip, 673 - unsigned short vid, int packet_subtype) 683 + static bool batadv_dat_forward_data(struct batadv_priv *bat_priv, 684 + struct sk_buff *skb, __be32 ip, 685 + unsigned short vid, int packet_subtype) 674 686 { 675 687 int i; 676 688 bool ret = false; ··· 1265 1277 ret = true; 1266 1278 } else { 1267 1279 /* Send the request to the DHT */ 1268 - ret = batadv_dat_send_data(bat_priv, skb, ip_dst, vid, 1269 - BATADV_P_DAT_DHT_GET); 1280 + ret = batadv_dat_forward_data(bat_priv, skb, ip_dst, vid, 1281 + BATADV_P_DAT_DHT_GET); 1270 1282 } 1271 1283 out: 1272 1284 if (dat_entry) ··· 1380 1392 /* Send the ARP reply to the candidates for both the IP addresses that 1381 1393 * the node obtained from the ARP reply 1382 1394 */ 1383 - batadv_dat_send_data(bat_priv, skb, ip_src, vid, BATADV_P_DAT_DHT_PUT); 1384 - batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT); 1395 + batadv_dat_forward_data(bat_priv, skb, ip_src, vid, 1396 + BATADV_P_DAT_DHT_PUT); 1397 + batadv_dat_forward_data(bat_priv, skb, ip_dst, vid, 1398 + BATADV_P_DAT_DHT_PUT); 1385 1399 } 1386 1400 1387 1401 /** ··· 1434 1444 hw_src, &ip_src, hw_dst, &ip_dst, 1435 1445 dat_entry->mac_addr, &dat_entry->ip); 1436 1446 dropped = true; 1437 - goto out; 1438 1447 } 1439 1448 1440 1449 /* Update our internal cache with both the IP addresses the node got ··· 1441 1452 */ 1442 1453 batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid); 1443 1454 batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid); 1455 + 1456 + if (dropped) 1457 + goto out; 1444 1458 1445 1459 /* If BLA is enabled, only forward ARP replies if we have claimed the 1446 1460 * source of the ARP reply or if no one else of the same backbone has ··· 1700 1708 batadv_dat_entry_add(bat_priv, yiaddr, chaddr, vid); 1701 1709 batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid); 1702 1710 1703 - batadv_dat_send_data(bat_priv, skb, yiaddr, vid, BATADV_P_DAT_DHT_PUT); 1704 - batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT); 1711 + batadv_dat_forward_data(bat_priv, skb, yiaddr, vid, 1712 + BATADV_P_DAT_DHT_PUT); 1713 + batadv_dat_forward_data(bat_priv, skb, ip_dst, vid, 1714 + BATADV_P_DAT_DHT_PUT); 1705 1715 1706 1716 consume_skb(skb); 1707 1717
-12
net/batman-adv/distributed-arp-table.h
··· 2 2 /* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_DISTRIBUTED_ARP_TABLE_H_
-12
net/batman-adv/fragmentation.c
··· 2 2 /* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "fragmentation.h"
-12
net/batman-adv/fragmentation.h
··· 2 2 /* Copyright (C) 2013-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_FRAGMENTATION_H_
-13
net/batman-adv/gateway_client.c
··· 2 2 /* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "gateway_client.h" ··· 41 53 #include "originator.h" 42 54 #include "routing.h" 43 55 #include "soft-interface.h" 44 - #include "sysfs.h" 45 56 #include "translation-table.h" 46 57 47 58 /* These are the offsets of the "hw type" and "hw address length" in the dhcp
-12
net/batman-adv/gateway_client.h
··· 2 2 /* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_GATEWAY_CLIENT_H_
-12
net/batman-adv/gateway_common.c
··· 2 2 /* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "gateway_common.h"
-12
net/batman-adv/gateway_common.h
··· 2 2 /* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
-12
net/batman-adv/hard-interface.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #include "hard-interface.h"
-12
net/batman-adv/hard-interface.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _NET_BATMAN_ADV_HARD_INTERFACE_H_
-12
net/batman-adv/hash.c
··· 2 2 /* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "hash.h"
-12
net/batman-adv/hash.h
··· 2 2 /* Copyright (C) 2006-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_HASH_H_
-12
net/batman-adv/icmp_socket.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "icmp_socket.h"
-12
net/batman-adv/icmp_socket.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_ICMP_SOCKET_H_
-12
net/batman-adv/log.c
··· 2 2 /* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "log.h"
-12
net/batman-adv/log.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _NET_BATMAN_ADV_LOG_H_
+73 -12
net/batman-adv/main.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #include "main.h" ··· 10 22 #include <linux/build_bug.h> 11 23 #include <linux/byteorder/generic.h> 12 24 #include <linux/crc32c.h> 25 + #include <linux/device.h> 13 26 #include <linux/errno.h> 14 27 #include <linux/genetlink.h> 15 28 #include <linux/gfp.h> ··· 20 31 #include <linux/ip.h> 21 32 #include <linux/ipv6.h> 22 33 #include <linux/kernel.h> 34 + #include <linux/kobject.h> 23 35 #include <linux/kref.h> 24 36 #include <linux/list.h> 25 37 #include <linux/module.h> ··· 30 40 #include <linux/rcupdate.h> 31 41 #include <linux/seq_file.h> 32 42 #include <linux/skbuff.h> 43 + #include <linux/slab.h> 33 44 #include <linux/spinlock.h> 34 45 #include <linux/stddef.h> 35 46 #include <linux/string.h> ··· 74 83 struct workqueue_struct *batadv_event_workqueue; 75 84 76 85 static void batadv_recv_handler_init(void); 86 + 87 + #define BATADV_UEV_TYPE_VAR "BATTYPE=" 88 + #define BATADV_UEV_ACTION_VAR "BATACTION=" 89 + #define BATADV_UEV_DATA_VAR "BATDATA=" 90 + 91 + static char *batadv_uev_action_str[] = { 92 + "add", 93 + "del", 94 + "change", 95 + "loopdetect", 96 + }; 97 + 98 + static char *batadv_uev_type_str[] = { 99 + "gw", 100 + "bla", 101 + }; 77 102 78 103 static int __init batadv_init(void) 79 104 { ··· 683 676 } 684 677 685 678 return ap_isolation_enabled; 679 + } 680 + 681 + /** 682 + * batadv_throw_uevent() - Send an uevent with batman-adv specific env data 683 + * @bat_priv: the bat priv with all the soft interface information 684 + * @type: subsystem type of event. Stored in uevent's BATTYPE 685 + * @action: action type of event. Stored in uevent's BATACTION 686 + * @data: string with additional information to the event (ignored for 687 + * BATADV_UEV_DEL). Stored in uevent's BATDATA 688 + * 689 + * Return: 0 on success or negative error number in case of failure 690 + */ 691 + int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, 692 + enum batadv_uev_action action, const char *data) 693 + { 694 + int ret = -ENOMEM; 695 + struct kobject *bat_kobj; 696 + char *uevent_env[4] = { NULL, NULL, NULL, NULL }; 697 + 698 + bat_kobj = &bat_priv->soft_iface->dev.kobj; 699 + 700 + uevent_env[0] = kasprintf(GFP_ATOMIC, 701 + "%s%s", BATADV_UEV_TYPE_VAR, 702 + batadv_uev_type_str[type]); 703 + if (!uevent_env[0]) 704 + goto out; 705 + 706 + uevent_env[1] = kasprintf(GFP_ATOMIC, 707 + "%s%s", BATADV_UEV_ACTION_VAR, 708 + batadv_uev_action_str[action]); 709 + if (!uevent_env[1]) 710 + goto out; 711 + 712 + /* If the event is DEL, ignore the data field */ 713 + if (action != BATADV_UEV_DEL) { 714 + uevent_env[2] = kasprintf(GFP_ATOMIC, 715 + "%s%s", BATADV_UEV_DATA_VAR, data); 716 + if (!uevent_env[2]) 717 + goto out; 718 + } 719 + 720 + ret = kobject_uevent_env(bat_kobj, KOBJ_CHANGE, uevent_env); 721 + out: 722 + kfree(uevent_env[0]); 723 + kfree(uevent_env[1]); 724 + kfree(uevent_env[2]); 725 + 726 + if (ret) 727 + batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 728 + "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n", 729 + batadv_uev_type_str[type], 730 + batadv_uev_action_str[action], 731 + (action == BATADV_UEV_DEL ? "NULL" : data), ret); 732 + return ret; 686 733 } 687 734 688 735 module_init(batadv_init);
+2 -12
net/batman-adv/main.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _NET_BATMAN_ADV_MAIN_H_ ··· 382 394 383 395 unsigned short batadv_get_vid(struct sk_buff *skb, size_t header_len); 384 396 bool batadv_vlan_ap_isola_get(struct batadv_priv *bat_priv, unsigned short vid); 397 + int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, 398 + enum batadv_uev_action action, const char *data); 385 399 386 400 #endif /* _NET_BATMAN_ADV_MAIN_H_ */
+198 -13
net/batman-adv/multicast.c
··· 2 2 /* Copyright (C) 2014-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "multicast.h" ··· 54 66 #include "hash.h" 55 67 #include "log.h" 56 68 #include "netlink.h" 69 + #include "send.h" 57 70 #include "soft-interface.h" 58 71 #include "translation-table.h" 59 72 #include "tvlv.h" ··· 980 991 { 981 992 int ret, tt_count, ip_count, unsnoop_count, total_count; 982 993 bool is_unsnoopable = false; 994 + unsigned int mcast_fanout; 983 995 struct ethhdr *ethhdr; 984 996 985 997 ret = batadv_mcast_forw_mode_check(bat_priv, skb, &is_unsnoopable); ··· 1015 1025 case 0: 1016 1026 return BATADV_FORW_NONE; 1017 1027 default: 1018 - return BATADV_FORW_ALL; 1028 + mcast_fanout = atomic_read(&bat_priv->multicast_fanout); 1029 + 1030 + if (!unsnoop_count && total_count <= mcast_fanout) 1031 + return BATADV_FORW_SOME; 1019 1032 } 1033 + 1034 + return BATADV_FORW_ALL; 1035 + } 1036 + 1037 + /** 1038 + * batadv_mcast_forw_tt() - forwards a packet to multicast listeners 1039 + * @bat_priv: the bat priv with all the soft interface information 1040 + * @skb: the multicast packet to transmit 1041 + * @vid: the vlan identifier 1042 + * 1043 + * Sends copies of a frame with multicast destination to any multicast 1044 + * listener registered in the translation table. A transmission is performed 1045 + * via a batman-adv unicast packet for each such destination node. 1046 + * 1047 + * Return: NET_XMIT_DROP on memory allocation failure, NET_XMIT_SUCCESS 1048 + * otherwise. 1049 + */ 1050 + static int 1051 + batadv_mcast_forw_tt(struct batadv_priv *bat_priv, struct sk_buff *skb, 1052 + unsigned short vid) 1053 + { 1054 + int ret = NET_XMIT_SUCCESS; 1055 + struct sk_buff *newskb; 1056 + 1057 + struct batadv_tt_orig_list_entry *orig_entry; 1058 + 1059 + struct batadv_tt_global_entry *tt_global; 1060 + const u8 *addr = eth_hdr(skb)->h_dest; 1061 + 1062 + tt_global = batadv_tt_global_hash_find(bat_priv, addr, vid); 1063 + if (!tt_global) 1064 + goto out; 1065 + 1066 + rcu_read_lock(); 1067 + hlist_for_each_entry_rcu(orig_entry, &tt_global->orig_list, list) { 1068 + newskb = skb_copy(skb, GFP_ATOMIC); 1069 + if (!newskb) { 1070 + ret = NET_XMIT_DROP; 1071 + break; 1072 + } 1073 + 1074 + batadv_send_skb_unicast(bat_priv, newskb, BATADV_UNICAST, 0, 1075 + orig_entry->orig_node, vid); 1076 + } 1077 + rcu_read_unlock(); 1078 + 1079 + batadv_tt_global_entry_put(tt_global); 1080 + 1081 + out: 1082 + return ret; 1083 + } 1084 + 1085 + /** 1086 + * batadv_mcast_forw_want_all_ipv4() - forward to nodes with want-all-ipv4 1087 + * @bat_priv: the bat priv with all the soft interface information 1088 + * @skb: the multicast packet to transmit 1089 + * @vid: the vlan identifier 1090 + * 1091 + * Sends copies of a frame with multicast destination to any node with a 1092 + * BATADV_MCAST_WANT_ALL_IPV4 flag set. A transmission is performed via a 1093 + * batman-adv unicast packet for each such destination node. 1094 + * 1095 + * Return: NET_XMIT_DROP on memory allocation failure, NET_XMIT_SUCCESS 1096 + * otherwise. 1097 + */ 1098 + static int 1099 + batadv_mcast_forw_want_all_ipv4(struct batadv_priv *bat_priv, 1100 + struct sk_buff *skb, unsigned short vid) 1101 + { 1102 + struct batadv_orig_node *orig_node; 1103 + int ret = NET_XMIT_SUCCESS; 1104 + struct sk_buff *newskb; 1105 + 1106 + rcu_read_lock(); 1107 + hlist_for_each_entry_rcu(orig_node, 1108 + &bat_priv->mcast.want_all_ipv4_list, 1109 + mcast_want_all_ipv4_node) { 1110 + newskb = skb_copy(skb, GFP_ATOMIC); 1111 + if (!newskb) { 1112 + ret = NET_XMIT_DROP; 1113 + break; 1114 + } 1115 + 1116 + batadv_send_skb_unicast(bat_priv, newskb, BATADV_UNICAST, 0, 1117 + orig_node, vid); 1118 + } 1119 + rcu_read_unlock(); 1120 + return ret; 1121 + } 1122 + 1123 + /** 1124 + * batadv_mcast_forw_want_all_ipv6() - forward to nodes with want-all-ipv6 1125 + * @bat_priv: the bat priv with all the soft interface information 1126 + * @skb: The multicast packet to transmit 1127 + * @vid: the vlan identifier 1128 + * 1129 + * Sends copies of a frame with multicast destination to any node with a 1130 + * BATADV_MCAST_WANT_ALL_IPV6 flag set. A transmission is performed via a 1131 + * batman-adv unicast packet for each such destination node. 1132 + * 1133 + * Return: NET_XMIT_DROP on memory allocation failure, NET_XMIT_SUCCESS 1134 + * otherwise. 1135 + */ 1136 + static int 1137 + batadv_mcast_forw_want_all_ipv6(struct batadv_priv *bat_priv, 1138 + struct sk_buff *skb, unsigned short vid) 1139 + { 1140 + struct batadv_orig_node *orig_node; 1141 + int ret = NET_XMIT_SUCCESS; 1142 + struct sk_buff *newskb; 1143 + 1144 + rcu_read_lock(); 1145 + hlist_for_each_entry_rcu(orig_node, 1146 + &bat_priv->mcast.want_all_ipv6_list, 1147 + mcast_want_all_ipv6_node) { 1148 + newskb = skb_copy(skb, GFP_ATOMIC); 1149 + if (!newskb) { 1150 + ret = NET_XMIT_DROP; 1151 + break; 1152 + } 1153 + 1154 + batadv_send_skb_unicast(bat_priv, newskb, BATADV_UNICAST, 0, 1155 + orig_node, vid); 1156 + } 1157 + rcu_read_unlock(); 1158 + return ret; 1159 + } 1160 + 1161 + /** 1162 + * batadv_mcast_forw_want_all() - forward packet to nodes in a want-all list 1163 + * @bat_priv: the bat priv with all the soft interface information 1164 + * @skb: the multicast packet to transmit 1165 + * @vid: the vlan identifier 1166 + * 1167 + * Sends copies of a frame with multicast destination to any node with a 1168 + * BATADV_MCAST_WANT_ALL_IPV4 or BATADV_MCAST_WANT_ALL_IPV6 flag set. A 1169 + * transmission is performed via a batman-adv unicast packet for each such 1170 + * destination node. 1171 + * 1172 + * Return: NET_XMIT_DROP on memory allocation failure or if the protocol family 1173 + * is neither IPv4 nor IPv6. NET_XMIT_SUCCESS otherwise. 1174 + */ 1175 + static int 1176 + batadv_mcast_forw_want_all(struct batadv_priv *bat_priv, 1177 + struct sk_buff *skb, unsigned short vid) 1178 + { 1179 + switch (ntohs(eth_hdr(skb)->h_proto)) { 1180 + case ETH_P_IP: 1181 + return batadv_mcast_forw_want_all_ipv4(bat_priv, skb, vid); 1182 + case ETH_P_IPV6: 1183 + return batadv_mcast_forw_want_all_ipv6(bat_priv, skb, vid); 1184 + default: 1185 + /* we shouldn't be here... */ 1186 + return NET_XMIT_DROP; 1187 + } 1188 + } 1189 + 1190 + /** 1191 + * batadv_mcast_forw_send() - send packet to any detected multicast recpient 1192 + * @bat_priv: the bat priv with all the soft interface information 1193 + * @skb: the multicast packet to transmit 1194 + * @vid: the vlan identifier 1195 + * 1196 + * Sends copies of a frame with multicast destination to any node that signaled 1197 + * interest in it, that is either via the translation table or the according 1198 + * want-all flags. A transmission is performed via a batman-adv unicast packet 1199 + * for each such destination node. 1200 + * 1201 + * The given skb is consumed/freed. 1202 + * 1203 + * Return: NET_XMIT_DROP on memory allocation failure or if the protocol family 1204 + * is neither IPv4 nor IPv6. NET_XMIT_SUCCESS otherwise. 1205 + */ 1206 + int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb, 1207 + unsigned short vid) 1208 + { 1209 + int ret; 1210 + 1211 + ret = batadv_mcast_forw_tt(bat_priv, skb, vid); 1212 + if (ret != NET_XMIT_SUCCESS) { 1213 + kfree_skb(skb); 1214 + return ret; 1215 + } 1216 + 1217 + ret = batadv_mcast_forw_want_all(bat_priv, skb, vid); 1218 + if (ret != NET_XMIT_SUCCESS) { 1219 + kfree_skb(skb); 1220 + return ret; 1221 + } 1222 + 1223 + consume_skb(skb); 1224 + return ret; 1020 1225 } 1021 1226 1022 1227 /**
+18 -12
net/batman-adv/multicast.h
··· 2 2 /* Copyright (C) 2014-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_MULTICAST_H_ ··· 24 36 BATADV_FORW_ALL, 25 37 26 38 /** 39 + * @BATADV_FORW_SOME: forward the packet to some nodes (currently via 40 + * a multicast-to-unicast conversion and the BATMAN unicast routing 41 + * protocol) 42 + */ 43 + BATADV_FORW_SOME, 44 + 45 + /** 27 46 * @BATADV_FORW_SINGLE: forward the packet to a single node (currently 28 47 * via the BATMAN unicast routing protocol) 29 48 */ ··· 45 50 enum batadv_forw_mode 46 51 batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb, 47 52 struct batadv_orig_node **mcast_single_orig); 53 + 54 + int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb, 55 + unsigned short vid); 48 56 49 57 void batadv_mcast_init(struct batadv_priv *bat_priv); 50 58 ··· 69 71 struct batadv_orig_node **mcast_single_orig) 70 72 { 71 73 return BATADV_FORW_ALL; 74 + } 75 + 76 + static inline int 77 + batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb, 78 + unsigned short vid) 79 + { 80 + kfree_skb(skb); 81 + return NET_XMIT_DROP; 72 82 } 73 83 74 84 static inline int batadv_mcast_init(struct batadv_priv *bat_priv)
+11 -12
net/batman-adv/netlink.c
··· 2 2 /* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "netlink.h" ··· 145 157 [BATADV_ATTR_HOP_PENALTY] = { .type = NLA_U8 }, 146 158 [BATADV_ATTR_LOG_LEVEL] = { .type = NLA_U32 }, 147 159 [BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED] = { .type = NLA_U8 }, 160 + [BATADV_ATTR_MULTICAST_FANOUT] = { .type = NLA_U32 }, 148 161 [BATADV_ATTR_NETWORK_CODING_ENABLED] = { .type = NLA_U8 }, 149 162 [BATADV_ATTR_ORIG_INTERVAL] = { .type = NLA_U32 }, 150 163 [BATADV_ATTR_ELP_INTERVAL] = { .type = NLA_U32 }, ··· 341 352 #ifdef CONFIG_BATMAN_ADV_MCAST 342 353 if (nla_put_u8(msg, BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED, 343 354 !atomic_read(&bat_priv->multicast_mode))) 355 + goto nla_put_failure; 356 + 357 + if (nla_put_u32(msg, BATADV_ATTR_MULTICAST_FANOUT, 358 + atomic_read(&bat_priv->multicast_fanout))) 344 359 goto nla_put_failure; 345 360 #endif /* CONFIG_BATMAN_ADV_MCAST */ 346 361 ··· 584 591 attr = info->attrs[BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED]; 585 592 586 593 atomic_set(&bat_priv->multicast_mode, !nla_get_u8(attr)); 594 + } 595 + 596 + if (info->attrs[BATADV_ATTR_MULTICAST_FANOUT]) { 597 + attr = info->attrs[BATADV_ATTR_MULTICAST_FANOUT]; 598 + 599 + atomic_set(&bat_priv->multicast_fanout, nla_get_u32(attr)); 587 600 } 588 601 #endif /* CONFIG_BATMAN_ADV_MCAST */ 589 602
-12
net/batman-adv/netlink.h
··· 2 2 /* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_NETLINK_H_
-12
net/batman-adv/network-coding.c
··· 2 2 /* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "network-coding.h"
-12
net/batman-adv/network-coding.h
··· 2 2 /* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_NETWORK_CODING_H_
-12
net/batman-adv/originator.c
··· 2 2 /* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #include "originator.h"
-12
net/batman-adv/originator.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _NET_BATMAN_ADV_ORIGINATOR_H_
-12
net/batman-adv/routing.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #include "routing.h"
-12
net/batman-adv/routing.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _NET_BATMAN_ADV_ROUTING_H_
-12
net/batman-adv/send.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #include "send.h"
-12
net/batman-adv/send.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _NET_BATMAN_ADV_SEND_H_
+6 -14
net/batman-adv/soft-interface.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #include "soft-interface.h" ··· 197 209 unsigned short vid; 198 210 u32 seqno; 199 211 int gw_mode; 200 - enum batadv_forw_mode forw_mode; 212 + enum batadv_forw_mode forw_mode = BATADV_FORW_SINGLE; 201 213 struct batadv_orig_node *mcast_single_orig = NULL; 202 214 int network_offset = ETH_HLEN; 203 215 __be16 proto; ··· 305 317 if (forw_mode == BATADV_FORW_NONE) 306 318 goto dropped; 307 319 308 - if (forw_mode == BATADV_FORW_SINGLE) 320 + if (forw_mode == BATADV_FORW_SINGLE || 321 + forw_mode == BATADV_FORW_SOME) 309 322 do_bcast = false; 310 323 } 311 324 } ··· 366 377 ret = batadv_send_skb_unicast(bat_priv, skb, 367 378 BATADV_UNICAST, 0, 368 379 mcast_single_orig, vid); 380 + } else if (forw_mode == BATADV_FORW_SOME) { 381 + ret = batadv_mcast_forw_send(bat_priv, skb, vid); 369 382 } else { 370 383 if (batadv_dat_snoop_outgoing_arp_request(bat_priv, 371 384 skb)) ··· 809 818 bat_priv->mcast.querier_ipv6.shadowing = false; 810 819 bat_priv->mcast.flags = BATADV_NO_FLAGS; 811 820 atomic_set(&bat_priv->multicast_mode, 1); 821 + atomic_set(&bat_priv->multicast_fanout, 16); 812 822 atomic_set(&bat_priv->mcast.num_want_all_unsnoopables, 0); 813 823 atomic_set(&bat_priv->mcast.num_want_all_ipv4, 0); 814 824 atomic_set(&bat_priv->mcast.num_want_all_ipv6, 0);
-12
net/batman-adv/soft-interface.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_
+46 -82
net/batman-adv/sysfs.c
··· 2 2 /* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "sysfs.h" 20 8 #include "main.h" 21 9 10 + #include <asm/current.h> 22 11 #include <linux/atomic.h> 23 12 #include <linux/compiler.h> 24 13 #include <linux/device.h> ··· 23 34 #include <linux/rculist.h> 24 35 #include <linux/rcupdate.h> 25 36 #include <linux/rtnetlink.h> 37 + #include <linux/sched.h> 26 38 #include <linux/slab.h> 27 39 #include <linux/stddef.h> 28 40 #include <linux/string.h> ··· 41 51 #include "netlink.h" 42 52 #include "network-coding.h" 43 53 #include "soft-interface.h" 54 + 55 + /** 56 + * batadv_sysfs_deprecated() - Log use of deprecated batadv sysfs access 57 + * @attr: attribute which was accessed 58 + */ 59 + static void batadv_sysfs_deprecated(struct attribute *attr) 60 + { 61 + pr_warn_ratelimited(DEPRECATED "%s (pid %d) Use of sysfs file \"%s\".\nUse batadv genl family instead", 62 + current->comm, task_pid_nr(current), attr->name); 63 + } 44 64 45 65 static struct net_device *batadv_kobj_to_netdev(struct kobject *obj) 46 66 { ··· 114 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 - 121 - static char *batadv_uev_action_str[] = { 122 - "add", 123 - "del", 124 - "change", 125 - "loopdetect", 126 - }; 127 - 128 - static char *batadv_uev_type_str[] = { 129 - "gw", 130 - "bla", 131 - }; 132 - 133 117 /* Use this, if you have customized show and store functions for vlan attrs */ 134 118 #define BATADV_ATTR_VLAN(_name, _mode, _show, _store) \ 135 119 struct batadv_attribute batadv_attr_vlan_##_name = { \ ··· 141 157 struct batadv_priv *bat_priv = netdev_priv(net_dev); \ 142 158 ssize_t length; \ 143 159 \ 160 + batadv_sysfs_deprecated(attr); \ 144 161 length = __batadv_store_bool_attr(buff, count, _post_func, attr,\ 145 162 &bat_priv->_name, net_dev); \ 146 163 \ ··· 156 171 { \ 157 172 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ 158 173 \ 174 + batadv_sysfs_deprecated(attr); \ 159 175 return sprintf(buff, "%s\n", \ 160 176 atomic_read(&bat_priv->_name) == 0 ? \ 161 177 "disabled" : "enabled"); \ ··· 180 194 struct batadv_priv *bat_priv = netdev_priv(net_dev); \ 181 195 ssize_t length; \ 182 196 \ 197 + batadv_sysfs_deprecated(attr); \ 183 198 length = __batadv_store_uint_attr(buff, count, _min, _max, \ 184 199 _post_func, attr, \ 185 200 &bat_priv->_var, net_dev, \ ··· 197 210 { \ 198 211 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ 199 212 \ 213 + batadv_sysfs_deprecated(attr); \ 200 214 return sprintf(buff, "%i\n", atomic_read(&bat_priv->_var)); \ 201 215 } \ 202 216 ··· 222 234 attr, &vlan->_name, \ 223 235 bat_priv->soft_iface); \ 224 236 \ 237 + batadv_sysfs_deprecated(attr); \ 225 238 if (vlan->vid) \ 226 239 batadv_netlink_notify_vlan(bat_priv, vlan); \ 227 240 else \ ··· 243 254 atomic_read(&vlan->_name) == 0 ? \ 244 255 "disabled" : "enabled"); \ 245 256 \ 257 + batadv_sysfs_deprecated(attr); \ 246 258 batadv_softif_vlan_put(vlan); \ 247 259 return res; \ 248 260 } ··· 265 275 struct batadv_priv *bat_priv; \ 266 276 ssize_t length; \ 267 277 \ 278 + batadv_sysfs_deprecated(attr); \ 268 279 hard_iface = batadv_hardif_get_by_netdev(net_dev); \ 269 280 if (!hard_iface) \ 270 281 return 0; \ ··· 293 302 struct batadv_hard_iface *hard_iface; \ 294 303 ssize_t length; \ 295 304 \ 305 + batadv_sysfs_deprecated(attr); \ 296 306 hard_iface = batadv_hardif_get_by_netdev(net_dev); \ 297 307 if (!hard_iface) \ 298 308 return 0; \ ··· 438 446 { 439 447 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 440 448 449 + batadv_sysfs_deprecated(attr); 441 450 return sprintf(buff, "%s\n", bat_priv->algo_ops->name); 442 451 } 443 452 ··· 454 461 { 455 462 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 456 463 int bytes_written; 464 + 465 + batadv_sysfs_deprecated(attr); 457 466 458 467 /* GW mode is not available if the routing algorithm in use does not 459 468 * implement the GW API ··· 490 495 struct batadv_priv *bat_priv = netdev_priv(net_dev); 491 496 char *curr_gw_mode_str; 492 497 int gw_mode_tmp = -1; 498 + 499 + batadv_sysfs_deprecated(attr); 493 500 494 501 /* toggling GW mode is allowed only if the routing algorithm in use 495 502 * provides the GW API ··· 567 570 { 568 571 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 569 572 573 + batadv_sysfs_deprecated(attr); 574 + 570 575 /* GW selection class is not available if the routing algorithm in use 571 576 * does not implement the GW API 572 577 */ ··· 588 589 { 589 590 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 590 591 ssize_t length; 592 + 593 + batadv_sysfs_deprecated(attr); 591 594 592 595 /* setting the GW selection class is allowed only if the routing 593 596 * algorithm in use implements the GW API ··· 621 620 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 622 621 u32 down, up; 623 622 623 + batadv_sysfs_deprecated(attr); 624 + 624 625 down = atomic_read(&bat_priv->gw.bandwidth_down); 625 626 up = atomic_read(&bat_priv->gw.bandwidth_up); 626 627 ··· 637 634 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 638 635 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); 639 636 ssize_t length; 637 + 638 + batadv_sysfs_deprecated(attr); 640 639 641 640 if (buff[count - 1] == '\n') 642 641 buff[count - 1] = '\0'; ··· 664 659 { 665 660 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); 666 661 662 + batadv_sysfs_deprecated(attr); 667 663 return sprintf(buff, "%#.8x/%#.8x\n", bat_priv->isolation_mark, 668 664 bat_priv->isolation_mark_mask); 669 665 } ··· 687 681 struct batadv_priv *bat_priv = netdev_priv(net_dev); 688 682 u32 mark, mask; 689 683 char *mask_ptr; 684 + 685 + batadv_sysfs_deprecated(attr); 690 686 691 687 /* parse the mask if it has been specified, otherwise assume the mask is 692 688 * the biggest possible ··· 945 937 ssize_t length; 946 938 const char *ifname; 947 939 940 + batadv_sysfs_deprecated(attr); 941 + 948 942 hard_iface = batadv_hardif_get_by_netdev(net_dev); 949 943 if (!hard_iface) 950 944 return 0; ··· 1051 1041 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); 1052 1042 struct batadv_store_mesh_work *store_work; 1053 1043 1044 + batadv_sysfs_deprecated(attr); 1045 + 1054 1046 if (buff[count - 1] == '\n') 1055 1047 buff[count - 1] = '\0'; 1056 1048 ··· 1083 1071 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); 1084 1072 struct batadv_hard_iface *hard_iface; 1085 1073 ssize_t length; 1074 + 1075 + batadv_sysfs_deprecated(attr); 1086 1076 1087 1077 hard_iface = batadv_hardif_get_by_netdev(net_dev); 1088 1078 if (!hard_iface) ··· 1137 1123 u32 old_tp_override; 1138 1124 bool ret; 1139 1125 1126 + batadv_sysfs_deprecated(attr); 1127 + 1140 1128 hard_iface = batadv_hardif_get_by_netdev(net_dev); 1141 1129 if (!hard_iface) 1142 1130 return -EINVAL; ··· 1177 1161 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); 1178 1162 struct batadv_hard_iface *hard_iface; 1179 1163 u32 tp_override; 1164 + 1165 + batadv_sysfs_deprecated(attr); 1180 1166 1181 1167 hard_iface = batadv_hardif_get_by_netdev(net_dev); 1182 1168 if (!hard_iface) ··· 1264 1246 kobject_del(*hardif_obj); 1265 1247 kobject_put(*hardif_obj); 1266 1248 *hardif_obj = NULL; 1267 - } 1268 - 1269 - /** 1270 - * batadv_throw_uevent() - Send an uevent with batman-adv specific env data 1271 - * @bat_priv: the bat priv with all the soft interface information 1272 - * @type: subsystem type of event. Stored in uevent's BATTYPE 1273 - * @action: action type of event. Stored in uevent's BATACTION 1274 - * @data: string with additional information to the event (ignored for 1275 - * BATADV_UEV_DEL). Stored in uevent's BATDATA 1276 - * 1277 - * Return: 0 on success or negative error number in case of failure 1278 - */ 1279 - int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, 1280 - enum batadv_uev_action action, const char *data) 1281 - { 1282 - int ret = -ENOMEM; 1283 - struct kobject *bat_kobj; 1284 - char *uevent_env[4] = { NULL, NULL, NULL, NULL }; 1285 - 1286 - bat_kobj = &bat_priv->soft_iface->dev.kobj; 1287 - 1288 - uevent_env[0] = kasprintf(GFP_ATOMIC, 1289 - "%s%s", BATADV_UEV_TYPE_VAR, 1290 - batadv_uev_type_str[type]); 1291 - if (!uevent_env[0]) 1292 - goto out; 1293 - 1294 - uevent_env[1] = kasprintf(GFP_ATOMIC, 1295 - "%s%s", BATADV_UEV_ACTION_VAR, 1296 - batadv_uev_action_str[action]); 1297 - if (!uevent_env[1]) 1298 - goto out; 1299 - 1300 - /* If the event is DEL, ignore the data field */ 1301 - if (action != BATADV_UEV_DEL) { 1302 - uevent_env[2] = kasprintf(GFP_ATOMIC, 1303 - "%s%s", BATADV_UEV_DATA_VAR, data); 1304 - if (!uevent_env[2]) 1305 - goto out; 1306 - } 1307 - 1308 - ret = kobject_uevent_env(bat_kobj, KOBJ_CHANGE, uevent_env); 1309 - out: 1310 - kfree(uevent_env[0]); 1311 - kfree(uevent_env[1]); 1312 - kfree(uevent_env[2]); 1313 - 1314 - if (ret) 1315 - batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 1316 - "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n", 1317 - batadv_uev_type_str[type], 1318 - batadv_uev_action_str[action], 1319 - (action == BATADV_UEV_DEL ? "NULL" : data), ret); 1320 - return ret; 1321 1249 }
+36 -14
net/batman-adv/sysfs.h
··· 2 2 /* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_SYSFS_H_ ··· 45 57 char *buf, size_t count); 46 58 }; 47 59 60 + #ifdef CONFIG_BATMAN_ADV_SYSFS 61 + 48 62 int batadv_sysfs_add_meshif(struct net_device *dev); 49 63 void batadv_sysfs_del_meshif(struct net_device *dev); 50 64 int batadv_sysfs_add_hardif(struct kobject **hardif_obj, ··· 56 66 struct batadv_softif_vlan *vlan); 57 67 void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv, 58 68 struct batadv_softif_vlan *vlan); 59 - int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, 60 - enum batadv_uev_action action, const char *data); 69 + 70 + #else 71 + 72 + static inline int batadv_sysfs_add_meshif(struct net_device *dev) 73 + { 74 + return 0; 75 + } 76 + 77 + static inline void batadv_sysfs_del_meshif(struct net_device *dev) 78 + { 79 + } 80 + 81 + static inline int batadv_sysfs_add_hardif(struct kobject **hardif_obj, 82 + struct net_device *dev) 83 + { 84 + return 0; 85 + } 86 + 87 + static inline void batadv_sysfs_del_hardif(struct kobject **hardif_obj) 88 + { 89 + } 90 + 91 + static inline int batadv_sysfs_add_vlan(struct net_device *dev, 92 + struct batadv_softif_vlan *vlan) 93 + { 94 + return 0; 95 + } 96 + 97 + static inline void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv, 98 + struct batadv_softif_vlan *vlan) 99 + { 100 + } 101 + 102 + #endif 61 103 62 104 #endif /* _NET_BATMAN_ADV_SYSFS_H_ */
-12
net/batman-adv/tp_meter.c
··· 2 2 /* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "tp_meter.h"
-12
net/batman-adv/tp_meter.h
··· 2 2 /* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_TP_METER_H_
-12
net/batman-adv/trace.c
··· 2 2 /* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #define CREATE_TRACE_POINTS
-12
net/batman-adv/trace.h
··· 2 2 /* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #if !defined(_NET_BATMAN_ADV_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
+2 -15
net/batman-adv/translation-table.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #include "translation-table.h" ··· 193 205 * Return: a pointer to the corresponding tt_global_entry struct if the client 194 206 * is found, NULL otherwise. 195 207 */ 196 - static struct batadv_tt_global_entry * 208 + struct batadv_tt_global_entry * 197 209 batadv_tt_global_hash_find(struct batadv_priv *bat_priv, const u8 *addr, 198 210 unsigned short vid) 199 211 { ··· 288 300 * possibly release it 289 301 * @tt_global_entry: tt_global_entry to be free'd 290 302 */ 291 - static void 292 - batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry) 303 + void batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry) 293 304 { 294 305 kref_put(&tt_global_entry->common.refcount, 295 306 batadv_tt_global_entry_release);
+4 -12
net/batman-adv/translation-table.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 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 7 #ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ ··· 29 41 void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, 30 42 struct batadv_orig_node *orig_node, 31 43 s32 match_vid, const char *message); 44 + struct batadv_tt_global_entry * 45 + batadv_tt_global_hash_find(struct batadv_priv *bat_priv, const u8 *addr, 46 + unsigned short vid); 47 + void batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry); 32 48 int batadv_tt_global_hash_count(struct batadv_priv *bat_priv, 33 49 const u8 *addr, unsigned short vid); 34 50 struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv,
-12
net/batman-adv/tvlv.c
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #include "main.h"
-12
net/batman-adv/tvlv.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _NET_BATMAN_ADV_TVLV_H_
+6 -12
net/batman-adv/types.h
··· 2 2 /* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors: 3 3 * 4 4 * Marek Lindner, Simon Wunderlich 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of version 2 of the GNU General Public 8 - * License as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope that it will be useful, but 11 - * WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 - * General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 5 */ 18 6 19 7 #ifndef _NET_BATMAN_ADV_TYPES_H_ ··· 1553 1565 * node's sender/originating side 1554 1566 */ 1555 1567 atomic_t multicast_mode; 1568 + 1569 + /** 1570 + * @multicast_fanout: Maximum number of packet copies to generate for a 1571 + * multicast-to-unicast conversion 1572 + */ 1573 + atomic_t multicast_fanout; 1556 1574 #endif 1557 1575 1558 1576 /** @orig_interval: OGM broadcast interval in milliseconds */