Hi,
currently the mtu size of batman-adv soft-interfaces is limited to
ETH_DATA_LEN (1500 bytes) in function batadv_hardif_min_mtu as far as I
understand.
A comment in this function states that batman-adv "does not support MTUs
bigger than ETH_DATA_LEN". Is there a specific reason for this or would it
be possible to increase the MTU size to something like 1518 by simply
replacing all limitations to ETH_DATA_LEN with a higher value?
Kind regards,
Andreas
..................................................................
PHOENIX CONTACT ELECTRONICS GmbH
Sitz der Gesellschaft / registered office of the company: 31812 Bad Pyrmont
USt-Id-Nr.: DE811742156
Amtsgericht Hannover HRB 100528 / district court Hannover HRB 100528
Geschäftsführer / Executive Board: Ulrich Leidecker, Christoph Leifer
__________________________________________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
----------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
___________________________________________________________________
An output mac address is 17 bytes
1
12345678901234567
00:11:22:33:44:55
but in net/batman-adv/distributed-arp-table.c
int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset)
{
[...]
seq_printf(seq, " * %15pI4 %14pM %4i %6i:%02i\n",
&dat_entry->ip, dat_entry->mac_addr,
batadv_print_vid(dat_entry->vid),
last_seen_mins, last_seen_secs);
%14pM is odd as this should not emit the last byte of the
mac address. So given the example above, it would output
00:11:22:33:44
Is that what's really desired?
If so, I'd suggest using something more obvious like %5phC
Hi David,
here is our feature/cleanup pull request of batman-adv to go into net-next.
Please pull or let me know of any problem!
Thank you,
Simon
The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batadv-next-for-davem-20170613
for you to fetch changes up to d62890885efbc48acea46964ea3af69b61c8c5eb:
batman-adv: Accept only filled wifi station info (2017-06-13 12:25:43 +0200)
----------------------------------------------------------------
This feature/cleanup patchset includes the following patches:
- bump version strings, by Simon Wunderlich
- decrease maximum fragment size, by Matthias Schiffer
- Clean up seqfile writing, by Markus Elfring (2 patches)
- use __func__ in debug messages, by Sven Eckelmann
- Mark tpmeter initializers with __init, by Antonio Quartulli
- ignore loop detection MAC addresses, by Simon Wunderlich
- clean up some return handling, by Simon Wunderlich
- improve ELP throughput value handling for WiFi neighbors
in BATMAN V/ELP, by Sven Eckelmann (2 patches)
----------------------------------------------------------------
Antonio Quartulli (1):
batman-adv: tp_meter: mark init function with __init
Markus Elfring (2):
batman-adv: Replace a seq_puts() call by seq_putc() in two functions
batman-adv: Combine two seq_puts() calls into one call in batadv_nc_nodes_seq_print_text()
Matthias Schiffer (1):
batman-adv: decrease maximum fragment size
Simon Wunderlich (3):
batman-adv: Start new development cycle
batman-adv: do not add loop detection mac addresses to global tt
batman-adv: simplify return handling in some TT functions
Sven Eckelmann (3):
batman-adv: Print correct function names in dbg messages
batman-adv: Use default throughput value on cfg80211 error
batman-adv: Accept only filled wifi station info
net/batman-adv/bat_iv_ogm.c | 5 ++-
net/batman-adv/bat_v.c | 2 +-
net/batman-adv/bat_v_elp.c | 10 ++++-
net/batman-adv/bridge_loop_avoidance.c | 73 ++++++++++++++++++----------------
net/batman-adv/distributed-arp-table.c | 2 +-
net/batman-adv/main.h | 4 +-
net/batman-adv/network-coding.c | 4 +-
net/batman-adv/routing.c | 4 +-
net/batman-adv/send.c | 6 +--
net/batman-adv/tp_meter.c | 3 +-
net/batman-adv/translation-table.c | 21 +++++-----
11 files changed, 72 insertions(+), 62 deletions(-)
Hi David,
here are two batman-adv bugfixes for net.
Please pull or let me know of any problem!
Thank you,
Simon
The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batadv-net-for-davem-20170613
for you to fetch changes up to a1a745ef980a1b48299ead4ea7990e62c0516f6e:
batman-adv: fix memory leak when dropping packet from other gateway (2017-05-19 12:20:28 +0200)
----------------------------------------------------------------
Here are two batman-adv bugfixes:
- fix rx packet counters for local ARP replies, by Sven Eckelmann
- fix memory leaks for unicast packetes received from another gateway
in bridge loop avoidance, by Andreas Pape
----------------------------------------------------------------
Andreas Pape (1):
batman-adv: fix memory leak when dropping packet from other gateway
Sven Eckelmann (1):
batman-adv: Fix rx packet/bytes stats on local ARP reply
net/batman-adv/distributed-arp-table.c | 5 +++--
net/batman-adv/routing.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
Hi all,
it's nothing to worry about but since 2011 I always noticed a clean
compile run of your code. Now with gcc 7.1.0 there are some warnings
and notes that might interest you:
~ LANG=C make
CC bat-hosts.o
CC debugfs.o
CC debug.o
CC functions.o
CC genl.o
CC hash.o
CC icmp_helper.o
CC interface.o
CC ioctl.o
CC main.o
CC netlink.o
CC ping.o
CC sys.o
In file included from sys.c:37:0:
sys.c: In function 'handle_ra_setting':
sys.h:33:25: warning: '%s' directive output may be truncated writing up to 255 bytes into a region of size 185 [-Wformat-truncation=]
#define SYS_IFACE_PATH "/sys/class/net"
^
sys.h:38:30: note: in expansion of macro 'SYS_IFACE_PATH'
#define SYS_ROUTING_ALGO_FMT SYS_IFACE_PATH"/%s/mesh/routing_algo"
^~~~~~~~~~~~~~
sys.c:480:38: note: in expansion of macro 'SYS_ROUTING_ALGO_FMT'
snprintf(path_buff, PATH_BUFF_LEN, SYS_ROUTING_ALGO_FMT, iface_dir->d_name);
^~~~~~~~~~~~~~~~~~~~
sys.h:38:46: note: format string is defined here
#define SYS_ROUTING_ALGO_FMT SYS_IFACE_PATH"/%s/mesh/routing_algo"
^~
sys.c:480:3: note: 'snprintf' output between 34 and 289 bytes into a destination of size 200
snprintf(path_buff, PATH_BUFF_LEN, SYS_ROUTING_ALGO_FMT, iface_dir->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC tcpdump.o
CC tp_meter.o
tp_meter.c: In function 'tp_meter':
tp_meter.c:502:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
printf("CANCEL received: test aborted\n");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tp_meter.c:504:2: note: here
case BATADV_TP_REASON_COMPLETE:
^~~~
CC traceroute.o
CC translate.o
LD batctl
# batctl -v
batctl 2017.1-1-g3069ca8 [batman-adv: 2017.1-4-g2149d80d]
It's really nothing bad at all. gcc 7.1.0 is somehow a little bit
capricious but with more suggestions to make cleaner code.
best regards
Philipp
Hi,
Here is a first patchset to reintroduce aggregation support for BATMAN V, too -
as well as any other packet type with a broadcast destination.
Branch:
* https://git.open-mesh.org/batman-adv.git/shortlog/refs/heads/linus/aggregat…
Regards, Linus
PS: Requires: "batman-adv: Introduce packet type independent TVLV handler API"
(40e5c9e798ec, available on patchwork or linus/aggregation branch)
---
Changelog:
v2:
* reset skb->cb on the soft-iface reception path, too [PATCH 5/6]
(thanks Sven!)
RFC->v1:
* removed tvlv (un)pack ctx wrappers
* fixed a crash when deaggregating ARP packets
* now compile tested down to 3.2, too (no issues found)
* now stress tested with multicast traffic of a larger, public mesh setup
A wifi interface should never be handled like an ethernet devices. The
parser of the cfg80211 output must therefore skip the ethtool code when
cfg80211_get_station returned an error.
Fixes: 01b1fe819ee0 ("batman-adv: refactor wifi interface detection")
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
v2:
- no changes
net/batman-adv/bat_v_elp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index b90c9903..96e73337 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -109,8 +109,10 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
*/
return 0;
}
- if (!ret)
- return sinfo.expected_throughput / 100;
+ if (ret)
+ goto default_throughput;
+
+ return sinfo.expected_throughput / 100;
}
/* if not a wifi interface, check if this device provides data via
--
2.11.0
From: "David S. Miller" <davem(a)davemloft.net>
Network devices can allocate reasources and private memory using
netdev_ops->ndo_init(). However, the release of these resources
can occur in one of two different places.
Either netdev_ops->ndo_uninit() or netdev->destructor().
The decision of which operation frees the resources depends upon
whether it is necessary for all netdev refs to be released before it
is safe to perform the freeing.
netdev_ops->ndo_uninit() presumably can occur right after the
NETDEV_UNREGISTER notifier completes and the unicast and multicast
address lists are flushed.
netdev->destructor(), on the other hand, does not run until the
netdev references all go away.
Further complicating the situation is that netdev->destructor()
almost universally does also a free_netdev().
This creates a problem for the logic in register_netdevice().
Because all callers of register_netdevice() manage the freeing
of the netdev, and invoke free_netdev(dev) if register_netdevice()
fails.
If netdev_ops->ndo_init() succeeds, but something else fails inside
of register_netdevice(), it does call ndo_ops->ndo_uninit(). But
it is not able to invoke netdev->destructor().
This is because netdev->destructor() will do a free_netdev() and
then the caller of register_netdevice() will do the same.
However, this means that the resources that would normally be released
by netdev->destructor() will not be.
Over the years drivers have added local hacks to deal with this, by
invoking their destructor parts by hand when register_netdevice()
fails.
Many drivers do not try to deal with this, and instead we have leaks.
Let's close this hole by formalizing the distinction between what
private things need to be freed up by netdev->destructor() and whether
the driver needs unregister_netdevice() to perform the free_netdev().
netdev->priv_destructor() performs all actions to free up the private
resources that used to be freed by netdev->destructor(), except for
free_netdev().
netdev->needs_free_netdev is a boolean that indicates whether
free_netdev() should be done at the end of unregister_netdevice().
Now, register_netdevice() can sanely release all resources after
ndo_ops->ndo_init() succeeds, by invoking both ndo_ops->ndo_uninit()
and netdev->priv_destructor().
And at the end of unregister_netdevice(), we invoke
netdev->priv_destructor() and optionally call free_netdev().
Signed-off-by: David S. Miller <davem(a)davemloft.net>
[sven(a)narfation.org: Add compat code]
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
compat-include/linux/netdevice.h | 19 +++++++++++++++++++
net/batman-adv/soft-interface.c | 5 ++---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h
index 1a37952c..ec6a5282 100644
--- a/compat-include/linux/netdevice.h
+++ b/compat-include/linux/netdevice.h
@@ -86,4 +86,23 @@ static inline void batadv_netif_trans_update(struct net_device *dev)
#endif /* < KERNEL_VERSION(4, 7, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+
+/* work around missing attribute needs_free_netdev and priv_destructor in
+ * net_device
+ */
+#define ether_setup(dev) \
+ void batadv_softif_free2(struct net_device *dev) \
+ { \
+ batadv_softif_free(dev); \
+ free_netdev(dev); \
+ } \
+ void (*t1)(struct net_device *dev) __attribute__((unused)); \
+ bool t2 __attribute__((unused)); \
+ ether_setup(dev)
+#define needs_free_netdev destructor = batadv_softif_free; t2
+#define priv_destructor destructor = batadv_softif_free2; t1
+
+#endif /* < KERNEL_VERSION(4, 12, 0) */
+
#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_NETDEVICE_H_ */
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index b25789ab..10f7edfb 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -1034,8 +1034,6 @@ static void batadv_softif_free(struct net_device *dev)
* netdev and its private data (bat_priv)
*/
rcu_barrier();
-
- free_netdev(dev);
}
/**
@@ -1047,7 +1045,8 @@ static void batadv_softif_init_early(struct net_device *dev)
ether_setup(dev);
dev->netdev_ops = &batadv_netdev_ops;
- dev->destructor = batadv_softif_free;
+ dev->needs_free_netdev = true;
+ dev->priv_destructor = batadv_softif_free;
dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_NETNS_LOCAL;
dev->priv_flags |= IFF_NO_QUEUE;
--
2.11.0
A wifi interface should never be handled like an ethernet devices. The
parser of the cfg80211 output must therefore skip the ethtool code when
cfg80211_get_station returned an error.
Fixes: 01b1fe819ee0 ("batman-adv: refactor wifi interface detection")
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
v2:
- no changes
net/batman-adv/bat_v_elp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index b90c9903..96e73337 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -109,8 +109,10 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
*/
return 0;
}
- if (!ret)
- return sinfo.expected_throughput / 100;
+ if (ret)
+ goto default_throughput;
+
+ return sinfo.expected_throughput / 100;
}
/* if not a wifi interface, check if this device provides data via
--
2.11.0
A wifi interface should never be handled like an ethernet devices. The
parser of the cfg80211 output must therefore skip the ethtool code when
cfg80211_get_station returned an error.
Fixes: 01b1fe819ee0 ("batman-adv: refactor wifi interface detection")
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
net/batman-adv/bat_v_elp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index b90c9903..96e73337 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -109,8 +109,10 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
*/
return 0;
}
- if (!ret)
- return sinfo.expected_throughput / 100;
+ if (ret)
+ goto default_throughput;
+
+ return sinfo.expected_throughput / 100;
}
/* if not a wifi interface, check if this device provides data via
--
2.11.0