This feature/cleanup patchset includes the following patches:
- bump version strings, by Simon Wunderlich - fix includes for _MAX constants, atomic functions and fwdecls, by Sven Eckelmann (3 patches) - shorten multicast tt/tvlv worker spinlock section, by Linus Luessing - routeable multicast preparations: implement MAC multicast filtering, by Linus Luessing (2 patches, David Millers comments integrated) - remove return value checks for debugfs_create, by Greg Kroah-Hartman - add routable multicast optimizations, by Linus Luessing (2 patches) -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEE1ilQI7G+y+fdhnrfoSvjmEKSnqEFAl0WG8UWHHN3QHNpbW9u d3VuZGVybGljaC5kZQAKCRChK+OYQpKeoWU9D/9bzRACAW/jwDqVw9NVk6kpjzXa fRj+4raXjDCug67XLdWd50KW+gen5HkkkOonu96Iew6ZGceTvqOciPKdVXnjH30n 2Bi/+K56LYWomaUMWD+aVhjgEKOIjDYd1ueqZCGsMrIFuhA5MonFWrigpSiQv0Gr s0cbxbKOl5EO+lGFgySYznVdJ/K+9RlHyGB+hkthg9CAFaJX92wvwcFW37+cLgOS 3B6T1PylyWn72uPfac2Jd0M8yQkPaNtZqwJBj8Y0wJ7cVfj29p/VZdlCn/g5oRKT VtRnuukOWNGn942+C88pl4YhC9rTipFb4qd9sgj5oDlj5d6B9+ZHy8vyhFQEByzJ 2l4rjkNIjwfEkw3QIxZT9/HFnyymrT08sGUtGzKAhIUcwXAe0Zm83EazGzig0UQ3 hjXZRloPldQ93CnboychqX7erDz3qGBTb+v+T+JDXzV0bR5UD4VWs/X2K6tls0nB bacin9O7VZgo2uaxkrzNKxzRKYPFn8LbpSitINZEYbNllncdCFfhEQ3depdc//SL WachCKPkwLRXSJCIXjnhGQSmLR4SvTP6xucr9ImwpE12Px4DWRGv8jux289q3flu ZdX2xAUsLMLsbKjELwAJrgH1HaKNZhsw16UxCc4QSNqe9RhwD/Qc/O6Gj11ONhGn 6ury81y2zFpBu4Acrg== =nP3L -----END PGP SIGNATURE----- Merge tag 'batadv-next-for-davem-20190627v2' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This feature/cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - fix includes for _MAX constants, atomic functions and fwdecls, by Sven Eckelmann (3 patches) - shorten multicast tt/tvlv worker spinlock section, by Linus Luessing - routeable multicast preparations: implement MAC multicast filtering, by Linus Luessing (2 patches, David Millers comments integrated) - remove return value checks for debugfs_create, by Greg Kroah-Hartman - add routable multicast optimizations, by Linus Luessing (2 patches) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
65dc5416d4
|
@ -107,12 +107,20 @@ enum batadv_icmp_packettype {
|
|||
* @BATADV_MCAST_WANT_ALL_UNSNOOPABLES: we want all packets destined for
|
||||
* 224.0.0.0/24 or ff02::1
|
||||
* @BATADV_MCAST_WANT_ALL_IPV4: we want all IPv4 multicast packets
|
||||
* (both link-local and routable ones)
|
||||
* @BATADV_MCAST_WANT_ALL_IPV6: we want all IPv6 multicast packets
|
||||
* (both link-local and routable ones)
|
||||
* @BATADV_MCAST_WANT_NO_RTR4: we have no IPv4 multicast router and therefore
|
||||
* only need routable IPv4 multicast packets we signed up for explicitly
|
||||
* @BATADV_MCAST_WANT_NO_RTR6: we have no IPv6 multicast router and therefore
|
||||
* only need routable IPv6 multicast packets we signed up for explicitly
|
||||
*/
|
||||
enum batadv_mcast_flags {
|
||||
BATADV_MCAST_WANT_ALL_UNSNOOPABLES = 1UL << 0,
|
||||
BATADV_MCAST_WANT_ALL_IPV4 = 1UL << 1,
|
||||
BATADV_MCAST_WANT_ALL_IPV6 = 1UL << 2,
|
||||
BATADV_MCAST_WANT_NO_RTR4 = 1UL << 3,
|
||||
BATADV_MCAST_WANT_NO_RTR6 = 1UL << 4,
|
||||
};
|
||||
|
||||
/* tt data subtypes */
|
||||
|
|
|
@ -9,12 +9,11 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct netlink_callback;
|
||||
struct seq_file;
|
||||
struct sk_buff;
|
||||
|
||||
extern char batadv_routing_algo[];
|
||||
extern struct list_head batadv_hardif_list;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <linux/rculist.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
|
@ -41,8 +42,6 @@
|
|||
#include "netlink.h"
|
||||
#include "originator.h"
|
||||
|
||||
struct sk_buff;
|
||||
|
||||
static void batadv_v_iface_activate(struct batadv_hard_iface *hard_iface)
|
||||
{
|
||||
struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
struct sk_buff;
|
||||
struct work_struct;
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
int batadv_v_elp_iface_enable(struct batadv_hard_iface *hard_iface);
|
||||
void batadv_v_elp_iface_disable(struct batadv_hard_iface *hard_iface);
|
||||
|
|
|
@ -9,10 +9,9 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct sk_buff;
|
||||
|
||||
int batadv_v_ogm_init(struct batadv_priv *bat_priv);
|
||||
void batadv_v_ogm_free(struct batadv_priv *bat_priv);
|
||||
int batadv_v_ogm_iface_enable(struct batadv_hard_iface *hard_iface);
|
||||
|
|
|
@ -10,14 +10,13 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct net_device;
|
||||
struct netlink_callback;
|
||||
struct seq_file;
|
||||
struct sk_buff;
|
||||
|
||||
/**
|
||||
* batadv_bla_is_loopdetect_mac() - check if the mac address is from a loop
|
||||
* detect frame sent by bridge loop avoidance
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <asm/current.h>
|
||||
#include <linux/dcache.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/fs.h>
|
||||
|
@ -293,31 +292,13 @@ static struct batadv_debuginfo *batadv_hardif_debuginfos[] = {
|
|||
void batadv_debugfs_init(void)
|
||||
{
|
||||
struct batadv_debuginfo **bat_debug;
|
||||
struct dentry *file;
|
||||
|
||||
batadv_debugfs = debugfs_create_dir(BATADV_DEBUGFS_SUBDIR, NULL);
|
||||
if (batadv_debugfs == ERR_PTR(-ENODEV))
|
||||
batadv_debugfs = NULL;
|
||||
|
||||
if (!batadv_debugfs)
|
||||
goto err;
|
||||
|
||||
for (bat_debug = batadv_general_debuginfos; *bat_debug; ++bat_debug) {
|
||||
file = debugfs_create_file(((*bat_debug)->attr).name,
|
||||
S_IFREG | ((*bat_debug)->attr).mode,
|
||||
batadv_debugfs, NULL,
|
||||
&(*bat_debug)->fops);
|
||||
if (!file) {
|
||||
pr_err("Can't add general debugfs file: %s\n",
|
||||
((*bat_debug)->attr).name);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
err:
|
||||
debugfs_remove_recursive(batadv_debugfs);
|
||||
batadv_debugfs = NULL;
|
||||
for (bat_debug = batadv_general_debuginfos; *bat_debug; ++bat_debug)
|
||||
debugfs_create_file(((*bat_debug)->attr).name,
|
||||
S_IFREG | ((*bat_debug)->attr).mode,
|
||||
batadv_debugfs, NULL, &(*bat_debug)->fops);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -333,42 +314,23 @@ void batadv_debugfs_destroy(void)
|
|||
* batadv_debugfs_add_hardif() - creates the base directory for a hard interface
|
||||
* in debugfs.
|
||||
* @hard_iface: hard interface which should be added.
|
||||
*
|
||||
* Return: 0 on success or negative error number in case of failure
|
||||
*/
|
||||
int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
|
||||
void batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
|
||||
{
|
||||
struct net *net = dev_net(hard_iface->net_dev);
|
||||
struct batadv_debuginfo **bat_debug;
|
||||
struct dentry *file;
|
||||
|
||||
if (!batadv_debugfs)
|
||||
goto out;
|
||||
|
||||
if (net != &init_net)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
hard_iface->debug_dir = debugfs_create_dir(hard_iface->net_dev->name,
|
||||
batadv_debugfs);
|
||||
if (!hard_iface->debug_dir)
|
||||
goto out;
|
||||
|
||||
for (bat_debug = batadv_hardif_debuginfos; *bat_debug; ++bat_debug) {
|
||||
file = debugfs_create_file(((*bat_debug)->attr).name,
|
||||
S_IFREG | ((*bat_debug)->attr).mode,
|
||||
hard_iface->debug_dir,
|
||||
hard_iface->net_dev,
|
||||
&(*bat_debug)->fops);
|
||||
if (!file)
|
||||
goto rem_attr;
|
||||
}
|
||||
|
||||
return 0;
|
||||
rem_attr:
|
||||
debugfs_remove_recursive(hard_iface->debug_dir);
|
||||
hard_iface->debug_dir = NULL;
|
||||
out:
|
||||
return -ENOMEM;
|
||||
for (bat_debug = batadv_hardif_debuginfos; *bat_debug; ++bat_debug)
|
||||
debugfs_create_file(((*bat_debug)->attr).name,
|
||||
S_IFREG | ((*bat_debug)->attr).mode,
|
||||
hard_iface->debug_dir, hard_iface->net_dev,
|
||||
&(*bat_debug)->fops);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -379,15 +341,12 @@ void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface)
|
|||
{
|
||||
const char *name = hard_iface->net_dev->name;
|
||||
struct dentry *dir;
|
||||
struct dentry *d;
|
||||
|
||||
dir = hard_iface->debug_dir;
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
d = debugfs_rename(dir->d_parent, dir, dir->d_parent, name);
|
||||
if (!d)
|
||||
pr_err("Can't rename debugfs dir to %s\n", name);
|
||||
debugfs_rename(dir->d_parent, dir, dir->d_parent, name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -419,44 +378,29 @@ int batadv_debugfs_add_meshif(struct net_device *dev)
|
|||
struct batadv_priv *bat_priv = netdev_priv(dev);
|
||||
struct batadv_debuginfo **bat_debug;
|
||||
struct net *net = dev_net(dev);
|
||||
struct dentry *file;
|
||||
|
||||
if (!batadv_debugfs)
|
||||
goto out;
|
||||
|
||||
if (net != &init_net)
|
||||
return 0;
|
||||
|
||||
bat_priv->debug_dir = debugfs_create_dir(dev->name, batadv_debugfs);
|
||||
if (!bat_priv->debug_dir)
|
||||
goto out;
|
||||
|
||||
if (batadv_socket_setup(bat_priv) < 0)
|
||||
goto rem_attr;
|
||||
batadv_socket_setup(bat_priv);
|
||||
|
||||
if (batadv_debug_log_setup(bat_priv) < 0)
|
||||
goto rem_attr;
|
||||
|
||||
for (bat_debug = batadv_mesh_debuginfos; *bat_debug; ++bat_debug) {
|
||||
file = debugfs_create_file(((*bat_debug)->attr).name,
|
||||
S_IFREG | ((*bat_debug)->attr).mode,
|
||||
bat_priv->debug_dir,
|
||||
dev, &(*bat_debug)->fops);
|
||||
if (!file) {
|
||||
batadv_err(dev, "Can't add debugfs file: %s/%s\n",
|
||||
dev->name, ((*bat_debug)->attr).name);
|
||||
goto rem_attr;
|
||||
}
|
||||
}
|
||||
for (bat_debug = batadv_mesh_debuginfos; *bat_debug; ++bat_debug)
|
||||
debugfs_create_file(((*bat_debug)->attr).name,
|
||||
S_IFREG | ((*bat_debug)->attr).mode,
|
||||
bat_priv->debug_dir, dev,
|
||||
&(*bat_debug)->fops);
|
||||
|
||||
if (batadv_nc_init_debugfs(bat_priv) < 0)
|
||||
goto rem_attr;
|
||||
batadv_nc_init_debugfs(bat_priv);
|
||||
|
||||
return 0;
|
||||
rem_attr:
|
||||
debugfs_remove_recursive(bat_priv->debug_dir);
|
||||
bat_priv->debug_dir = NULL;
|
||||
out:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -469,15 +413,12 @@ void batadv_debugfs_rename_meshif(struct net_device *dev)
|
|||
struct batadv_priv *bat_priv = netdev_priv(dev);
|
||||
const char *name = dev->name;
|
||||
struct dentry *dir;
|
||||
struct dentry *d;
|
||||
|
||||
dir = bat_priv->debug_dir;
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
d = debugfs_rename(dir->d_parent, dir, dir->d_parent, name);
|
||||
if (!d)
|
||||
pr_err("Can't rename debugfs dir to %s\n", name);
|
||||
debugfs_rename(dir->d_parent, dir, dir->d_parent, name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
struct file;
|
||||
struct net_device;
|
||||
#include <linux/fs.h>
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
#define BATADV_DEBUGFS_SUBDIR "batman_adv"
|
||||
|
||||
|
@ -22,7 +22,7 @@ void batadv_debugfs_destroy(void);
|
|||
int batadv_debugfs_add_meshif(struct net_device *dev);
|
||||
void batadv_debugfs_rename_meshif(struct net_device *dev);
|
||||
void batadv_debugfs_del_meshif(struct net_device *dev);
|
||||
int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface);
|
||||
void batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface);
|
||||
void batadv_debugfs_rename_hardif(struct batadv_hard_iface *hard_iface);
|
||||
void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface);
|
||||
|
||||
|
@ -54,9 +54,8 @@ static inline void batadv_debugfs_del_meshif(struct net_device *dev)
|
|||
}
|
||||
|
||||
static inline
|
||||
int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
|
||||
void batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
|
|
|
@ -11,15 +11,14 @@
|
|||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
|
||||
#include "originator.h"
|
||||
|
||||
struct netlink_callback;
|
||||
struct seq_file;
|
||||
struct sk_buff;
|
||||
|
||||
#ifdef CONFIG_BATMAN_ADV_DAT
|
||||
|
||||
/* BATADV_DAT_ADDR_MAX - maximum address value in the DHT space */
|
||||
|
|
|
@ -11,11 +11,10 @@
|
|||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct sk_buff;
|
||||
|
||||
void batadv_frag_purge_orig(struct batadv_orig_node *orig,
|
||||
bool (*check_cb)(struct batadv_frag_table_entry *));
|
||||
bool batadv_frag_skb_fwd(struct sk_buff *skb,
|
||||
|
|
|
@ -9,12 +9,11 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct batadv_tvlv_gateway_data;
|
||||
struct netlink_callback;
|
||||
struct seq_file;
|
||||
struct sk_buff;
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
|
||||
void batadv_gw_check_client_stop(struct batadv_priv *bat_priv);
|
||||
void batadv_gw_reselect(struct batadv_priv *bat_priv);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/byteorder/generic.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/math64.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/stddef.h>
|
||||
|
|
|
@ -9,10 +9,9 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct net_device;
|
||||
|
||||
/**
|
||||
* enum batadv_bandwidth_units - bandwidth unit types
|
||||
*/
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/if_ether.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/printk.h>
|
||||
|
@ -920,9 +921,7 @@ batadv_hardif_add_interface(struct net_device *net_dev)
|
|||
hard_iface->soft_iface = NULL;
|
||||
hard_iface->if_status = BATADV_IF_NOT_IN_USE;
|
||||
|
||||
ret = batadv_debugfs_add_hardif(hard_iface);
|
||||
if (ret)
|
||||
goto free_sysfs;
|
||||
batadv_debugfs_add_hardif(hard_iface);
|
||||
|
||||
INIT_LIST_HEAD(&hard_iface->list);
|
||||
INIT_HLIST_HEAD(&hard_iface->neigh_list);
|
||||
|
@ -944,8 +943,6 @@ batadv_hardif_add_interface(struct net_device *net_dev)
|
|||
|
||||
return hard_iface;
|
||||
|
||||
free_sysfs:
|
||||
batadv_sysfs_del_hardif(&hard_iface->hardif_obj);
|
||||
free_if:
|
||||
kfree(hard_iface);
|
||||
release_dev:
|
||||
|
|
|
@ -11,13 +11,12 @@
|
|||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct net_device;
|
||||
struct net;
|
||||
#include <net/net_namespace.h>
|
||||
|
||||
/**
|
||||
* enum batadv_hard_if_state - State of a hard interface
|
||||
|
|
|
@ -12,13 +12,12 @@
|
|||
#include <linux/atomic.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/lockdep.h>
|
||||
#include <linux/rculist.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct lock_class_key;
|
||||
|
||||
/* callback to a compare function. should compare 2 element datas for their
|
||||
* keys
|
||||
*
|
||||
|
|
|
@ -314,25 +314,11 @@ static const struct file_operations batadv_fops = {
|
|||
/**
|
||||
* batadv_socket_setup() - Create debugfs "socket" file
|
||||
* @bat_priv: the bat priv with all the soft interface information
|
||||
*
|
||||
* Return: 0 on success or negative error number in case of failure
|
||||
*/
|
||||
int batadv_socket_setup(struct batadv_priv *bat_priv)
|
||||
void batadv_socket_setup(struct batadv_priv *bat_priv)
|
||||
{
|
||||
struct dentry *d;
|
||||
|
||||
if (!bat_priv->debug_dir)
|
||||
goto err;
|
||||
|
||||
d = debugfs_create_file(BATADV_ICMP_SOCKET, 0600, bat_priv->debug_dir,
|
||||
bat_priv, &batadv_fops);
|
||||
if (!d)
|
||||
goto err;
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
return -ENOMEM;
|
||||
debugfs_create_file(BATADV_ICMP_SOCKET, 0600, bat_priv->debug_dir,
|
||||
bat_priv, &batadv_fops);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,12 +10,11 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct batadv_icmp_header;
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
|
||||
#define BATADV_ICMP_SOCKET "socket"
|
||||
|
||||
int batadv_socket_setup(struct batadv_priv *bat_priv);
|
||||
void batadv_socket_setup(struct batadv_priv *bat_priv);
|
||||
|
||||
#ifdef CONFIG_BATMAN_ADV_DEBUGFS
|
||||
|
||||
|
|
|
@ -190,27 +190,16 @@ static const struct file_operations batadv_log_fops = {
|
|||
*/
|
||||
int batadv_debug_log_setup(struct batadv_priv *bat_priv)
|
||||
{
|
||||
struct dentry *d;
|
||||
|
||||
if (!bat_priv->debug_dir)
|
||||
goto err;
|
||||
|
||||
bat_priv->debug_log = kzalloc(sizeof(*bat_priv->debug_log), GFP_ATOMIC);
|
||||
if (!bat_priv->debug_log)
|
||||
goto err;
|
||||
return -ENOMEM;
|
||||
|
||||
spin_lock_init(&bat_priv->debug_log->lock);
|
||||
init_waitqueue_head(&bat_priv->debug_log->queue_wait);
|
||||
|
||||
d = debugfs_create_file("log", 0400, bat_priv->debug_dir, bat_priv,
|
||||
&batadv_log_fops);
|
||||
if (!d)
|
||||
goto err;
|
||||
|
||||
debugfs_create_file("log", 0400, bat_priv->debug_dir, bat_priv,
|
||||
&batadv_log_fops);
|
||||
return 0;
|
||||
|
||||
err:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/printk.h>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#define BATADV_DRIVER_DEVICE "batman-adv"
|
||||
|
||||
#ifndef BATADV_SOURCE_VERSION
|
||||
#define BATADV_SOURCE_VERSION "2019.2"
|
||||
#define BATADV_SOURCE_VERSION "2019.3"
|
||||
#endif
|
||||
|
||||
/* B.A.T.M.A.N. parameters */
|
||||
|
@ -205,20 +205,20 @@ enum batadv_uev_type {
|
|||
|
||||
/* Kernel headers */
|
||||
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
struct net_device;
|
||||
struct packet_type;
|
||||
struct seq_file;
|
||||
struct sk_buff;
|
||||
#include "main.h"
|
||||
|
||||
/**
|
||||
* batadv_print_vid() - return printable version of vid information
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,9 +9,9 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
struct netlink_callback;
|
||||
struct seq_file;
|
||||
struct sk_buff;
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
|
||||
/**
|
||||
* enum batadv_forw_mode - the way a packet should be forwarded as
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <linux/if_vlan.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/netlink.h>
|
||||
|
@ -30,6 +31,7 @@
|
|||
#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
#include <net/genetlink.h>
|
||||
#include <net/net_namespace.h>
|
||||
#include <net/netlink.h>
|
||||
#include <net/sock.h>
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
|
@ -49,8 +51,6 @@
|
|||
#include "tp_meter.h"
|
||||
#include "translation-table.h"
|
||||
|
||||
struct net;
|
||||
|
||||
struct genl_family batadv_netlink_family;
|
||||
|
||||
/* multicast groups */
|
||||
|
|
|
@ -9,11 +9,10 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/types.h>
|
||||
#include <net/genetlink.h>
|
||||
|
||||
struct nlmsghdr;
|
||||
|
||||
void batadv_netlink_register(void);
|
||||
void batadv_netlink_unregister(void);
|
||||
int batadv_netlink_get_ifindex(const struct nlmsghdr *nlh, int attrtype);
|
||||
|
|
|
@ -1951,34 +1951,19 @@ out:
|
|||
/**
|
||||
* batadv_nc_init_debugfs() - create nc folder and related files in debugfs
|
||||
* @bat_priv: the bat priv with all the soft interface information
|
||||
*
|
||||
* Return: 0 on success or negative error number in case of failure
|
||||
*/
|
||||
int batadv_nc_init_debugfs(struct batadv_priv *bat_priv)
|
||||
void batadv_nc_init_debugfs(struct batadv_priv *bat_priv)
|
||||
{
|
||||
struct dentry *nc_dir, *file;
|
||||
struct dentry *nc_dir;
|
||||
|
||||
nc_dir = debugfs_create_dir("nc", bat_priv->debug_dir);
|
||||
if (!nc_dir)
|
||||
goto out;
|
||||
|
||||
file = debugfs_create_u8("min_tq", 0644, nc_dir, &bat_priv->nc.min_tq);
|
||||
if (!file)
|
||||
goto out;
|
||||
debugfs_create_u8("min_tq", 0644, nc_dir, &bat_priv->nc.min_tq);
|
||||
|
||||
file = debugfs_create_u32("max_fwd_delay", 0644, nc_dir,
|
||||
&bat_priv->nc.max_fwd_delay);
|
||||
if (!file)
|
||||
goto out;
|
||||
debugfs_create_u32("max_fwd_delay", 0644, nc_dir,
|
||||
&bat_priv->nc.max_fwd_delay);
|
||||
|
||||
file = debugfs_create_u32("max_buffer_time", 0644, nc_dir,
|
||||
&bat_priv->nc.max_buffer_time);
|
||||
if (!file)
|
||||
goto out;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
return -ENOMEM;
|
||||
debugfs_create_u32("max_buffer_time", 0644, nc_dir,
|
||||
&bat_priv->nc.max_buffer_time);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -9,12 +9,11 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct batadv_ogm_packet;
|
||||
struct net_device;
|
||||
struct seq_file;
|
||||
struct sk_buff;
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
|
||||
#ifdef CONFIG_BATMAN_ADV_NC
|
||||
|
||||
|
@ -40,7 +39,7 @@ void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
|
|||
void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv,
|
||||
struct sk_buff *skb);
|
||||
int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset);
|
||||
int batadv_nc_init_debugfs(struct batadv_priv *bat_priv);
|
||||
void batadv_nc_init_debugfs(struct batadv_priv *bat_priv);
|
||||
|
||||
#else /* ifdef CONFIG_BATMAN_ADV_NC */
|
||||
|
||||
|
@ -111,9 +110,8 @@ static inline int batadv_nc_nodes_seq_print_text(struct seq_file *seq,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int batadv_nc_init_debugfs(struct batadv_priv *bat_priv)
|
||||
static inline void batadv_nc_init_debugfs(struct batadv_priv *bat_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* ifdef CONFIG_BATMAN_ADV_NC */
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <linux/stddef.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <net/sock.h>
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
#include <uapi/linux/batman_adv.h>
|
||||
|
||||
#include "bat_algo.h"
|
||||
|
@ -1043,7 +1044,8 @@ struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv,
|
|||
orig_node->bcast_seqno_reset = reset_time;
|
||||
|
||||
#ifdef CONFIG_BATMAN_ADV_MCAST
|
||||
orig_node->mcast_flags = BATADV_NO_FLAGS;
|
||||
orig_node->mcast_flags = BATADV_MCAST_WANT_NO_RTR4;
|
||||
orig_node->mcast_flags |= BATADV_MCAST_WANT_NO_RTR6;
|
||||
INIT_HLIST_NODE(&orig_node->mcast_want_all_unsnoopables_node);
|
||||
INIT_HLIST_NODE(&orig_node->mcast_want_all_ipv4_node);
|
||||
INIT_HLIST_NODE(&orig_node->mcast_want_all_ipv6_node);
|
||||
|
|
|
@ -12,12 +12,11 @@
|
|||
#include <linux/compiler.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/jhash.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct netlink_callback;
|
||||
struct seq_file;
|
||||
struct sk_buff;
|
||||
|
||||
bool batadv_compare_orig(const struct hlist_node *node, const void *data2);
|
||||
int batadv_originator_init(struct batadv_priv *bat_priv);
|
||||
void batadv_originator_free(struct batadv_priv *bat_priv);
|
||||
|
|
|
@ -9,10 +9,9 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct sk_buff;
|
||||
|
||||
bool batadv_check_management_packet(struct sk_buff *skb,
|
||||
struct batadv_hard_iface *hard_iface,
|
||||
int header_len);
|
||||
|
|
|
@ -10,12 +10,11 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
|
||||
struct sk_buff;
|
||||
|
||||
void batadv_forw_packet_free(struct batadv_forw_packet *forw_packet,
|
||||
bool dropped);
|
||||
struct batadv_forw_packet *
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <linux/list.h>
|
||||
#include <linux/lockdep.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/printk.h>
|
||||
#include <linux/random.h>
|
||||
|
@ -803,11 +804,6 @@ static int batadv_softif_init_late(struct net_device *dev)
|
|||
atomic_set(&bat_priv->distributed_arp_table, 1);
|
||||
#endif
|
||||
#ifdef CONFIG_BATMAN_ADV_MCAST
|
||||
bat_priv->mcast.querier_ipv4.exists = false;
|
||||
bat_priv->mcast.querier_ipv4.shadowing = false;
|
||||
bat_priv->mcast.querier_ipv6.exists = false;
|
||||
bat_priv->mcast.querier_ipv6.shadowing = false;
|
||||
bat_priv->mcast.flags = BATADV_NO_FLAGS;
|
||||
atomic_set(&bat_priv->multicast_mode, 1);
|
||||
atomic_set(&bat_priv->multicast_fanout, 16);
|
||||
atomic_set(&bat_priv->mcast.num_want_all_unsnoopables, 0);
|
||||
|
|
|
@ -9,13 +9,12 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
#include <net/net_namespace.h>
|
||||
#include <net/rtnetlink.h>
|
||||
|
||||
struct net_device;
|
||||
struct net;
|
||||
struct sk_buff;
|
||||
|
||||
int batadv_skb_head_push(struct sk_buff *skb, unsigned int len);
|
||||
void batadv_interface_rx(struct net_device *soft_iface,
|
||||
struct sk_buff *skb, int hdr_size,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/printk.h>
|
||||
#include <linux/rculist.h>
|
||||
|
|
|
@ -9,12 +9,11 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct kobject;
|
||||
struct net_device;
|
||||
|
||||
#define BATADV_SYSFS_IF_MESH_SUBDIR "mesh"
|
||||
#define BATADV_SYSFS_IF_BAT_SUBDIR "batman_adv"
|
||||
/**
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/param.h>
|
||||
|
|
|
@ -9,10 +9,9 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct sk_buff;
|
||||
|
||||
void batadv_tp_meter_init(void);
|
||||
void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst,
|
||||
u32 test_length, u32 *cookie);
|
||||
|
|
|
@ -9,13 +9,12 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct netlink_callback;
|
||||
struct net_device;
|
||||
struct seq_file;
|
||||
struct sk_buff;
|
||||
|
||||
int batadv_tt_init(struct batadv_priv *bat_priv);
|
||||
bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr,
|
||||
unsigned short vid, int ifindex, u32 mark);
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct batadv_ogm_packet;
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
|
||||
void batadv_tvlv_container_register(struct batadv_priv *bat_priv,
|
||||
u8 type, u8 version,
|
||||
|
|
|
@ -14,20 +14,22 @@
|
|||
#include <linux/average.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/sched.h> /* for linux/wait.h */
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <uapi/linux/batadv_packet.h>
|
||||
#include <uapi/linux/batman_adv.h>
|
||||
|
||||
struct seq_file;
|
||||
|
||||
#ifdef CONFIG_BATMAN_ADV_DAT
|
||||
|
||||
/**
|
||||
|
@ -402,6 +404,17 @@ struct batadv_orig_node {
|
|||
* list
|
||||
*/
|
||||
struct hlist_node mcast_want_all_ipv6_node;
|
||||
|
||||
/**
|
||||
* @mcast_want_all_rtr4_node: a list node for the mcast.want_all_rtr4
|
||||
* list
|
||||
*/
|
||||
struct hlist_node mcast_want_all_rtr4_node;
|
||||
/**
|
||||
* @mcast_want_all_rtr6_node: a list node for the mcast.want_all_rtr6
|
||||
* list
|
||||
*/
|
||||
struct hlist_node mcast_want_all_rtr6_node;
|
||||
#endif
|
||||
|
||||
/** @capabilities: announced capabilities of this originator */
|
||||
|
@ -1168,6 +1181,26 @@ struct batadv_mcast_querier_state {
|
|||
unsigned char shadowing:1;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct batadv_mcast_mla_flags - flags for the querier, bridge and tvlv state
|
||||
*/
|
||||
struct batadv_mcast_mla_flags {
|
||||
/** @querier_ipv4: the current state of an IGMP querier in the mesh */
|
||||
struct batadv_mcast_querier_state querier_ipv4;
|
||||
|
||||
/** @querier_ipv6: the current state of an MLD querier in the mesh */
|
||||
struct batadv_mcast_querier_state querier_ipv6;
|
||||
|
||||
/** @enabled: whether the multicast tvlv is currently enabled */
|
||||
unsigned char enabled:1;
|
||||
|
||||
/** @bridged: whether the soft interface has a bridge on top */
|
||||
unsigned char bridged:1;
|
||||
|
||||
/** @tvlv_flags: the flags we have last sent in our mcast tvlv */
|
||||
u8 tvlv_flags;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct batadv_priv_mcast - per mesh interface mcast data
|
||||
*/
|
||||
|
@ -1196,20 +1229,22 @@ struct batadv_priv_mcast {
|
|||
*/
|
||||
struct hlist_head want_all_ipv6_list;
|
||||
|
||||
/** @querier_ipv4: the current state of an IGMP querier in the mesh */
|
||||
struct batadv_mcast_querier_state querier_ipv4;
|
||||
/**
|
||||
* @want_all_rtr4_list: a list of orig_nodes wanting all routable IPv4
|
||||
* multicast traffic
|
||||
*/
|
||||
struct hlist_head want_all_rtr4_list;
|
||||
|
||||
/** @querier_ipv6: the current state of an MLD querier in the mesh */
|
||||
struct batadv_mcast_querier_state querier_ipv6;
|
||||
/**
|
||||
* @want_all_rtr6_list: a list of orig_nodes wanting all routable IPv6
|
||||
* multicast traffic
|
||||
*/
|
||||
struct hlist_head want_all_rtr6_list;
|
||||
|
||||
/** @flags: the flags we have last sent in our mcast tvlv */
|
||||
u8 flags;
|
||||
|
||||
/** @enabled: whether the multicast tvlv is currently enabled */
|
||||
unsigned char enabled:1;
|
||||
|
||||
/** @bridged: whether the soft interface has a bridge on top */
|
||||
unsigned char bridged:1;
|
||||
/**
|
||||
* @mla_flags: flags for the querier, bridge and tvlv state
|
||||
*/
|
||||
struct batadv_mcast_mla_flags mla_flags;
|
||||
|
||||
/**
|
||||
* @mla_lock: a lock protecting mla_list and mla_flags
|
||||
|
@ -1228,6 +1263,12 @@ struct batadv_priv_mcast {
|
|||
/** @num_want_all_ipv6: counter for items in want_all_ipv6_list */
|
||||
atomic_t num_want_all_ipv6;
|
||||
|
||||
/** @num_want_all_rtr4: counter for items in want_all_rtr4_list */
|
||||
atomic_t num_want_all_rtr4;
|
||||
|
||||
/** @num_want_all_rtr6: counter for items in want_all_rtr6_list */
|
||||
atomic_t num_want_all_rtr6;
|
||||
|
||||
/**
|
||||
* @want_lists_lock: lock for protecting modifications to mcasts
|
||||
* want_all_{unsnoopables,ipv4,ipv6}_list (traversals are rcu-locked)
|
||||
|
|
Loading…
Reference in New Issue