On Monday, 26 December 2022 21:42:36 CET Linus Lüssing wrote:
Implement the preparation of a batman-adv multicast
packet and use this
under certain conditions.
For one thing this implements the capability to push a complete
batman-adv multicast packet header, including a tracker TVLV with all
originator destinations that have signaled interest in it, onto a given
ethernet frame with an IP multicast packet inside.
For another checks are implemented to determine if encapsulating a
multicast packet in this new batman-adv multicast packet type and using
it is feasible. Those checks are:
1) Have all nodes signaled that they are capable of handling the new
batman-adv multicast packet type?
2) Do all active hard interfaces of all nodes, including us, have an MTU
of at least 1280 bytes?
3) Does a complete multicast packet header with all its destination
addresses fit onto the given multicast packet / ethernet frame and
does not exceed 1280 bytes?
If all checks passed then the new batman-adv multicast packet type will
be used for transmission and distribution. Otherwise we fall back to one or
more batman-adv unicast packet transmissions, if possible. Or if not
possible we will fall back to classic flooding through a batman-adv
broadcast packet.
Signed-off-by: Linus Lüssing <linus.luessing(a)c0d3.blue>
---
net/batman-adv/multicast.c | 79 ++++-
net/batman-adv/multicast.h | 24 +-
net/batman-adv/multicast_forw.c | 511 ++++++++++++++++++++++++++++++++
net/batman-adv/soft-interface.c | 6 +-
net/batman-adv/types.h | 6 +
5 files changed, 618 insertions(+), 8 deletions(-)
ecsv/pu: checkpatch ./net/batman-adv/multicast_forw.c
-----------------------------------------------------
CHECK: Macro argument reuse 'num_dests' - possible side-effects?
#35: FILE: ./net/batman-adv/multicast_forw.c:35:
+#define batadv_mcast_forw_tracker_for_each_dest(dest, num_dests) \
+ for (; num_dests; num_dests--, (dest) += ETH_ALEN)
total: 0 errors, 0 warnings, 1 checks, 785 lines checked
ecsv/pu: headers
----------------
diff --git a/net/batman-adv/multicast.h b/net/batman-adv/multicast.h
index 0f0d79c8..4393c3a2 100644
--- a/net/batman-adv/multicast.h
+++ b/net/batman-adv/multicast.h
@@ -11,6 +11,7 @@
#include <linux/netlink.h>
#include <linux/skbuff.h>
+#include <linux/types.h>
/**
* enum batadv_forw_mode - the way a packet should be forwarded as
ecsv/pu: kerneldoc ./net/batman-adv/multicast_forw.c
----------------------------------------------------
./net/batman-adv/multicast_forw.c:83: warning: Function parameter or member
'bat_priv' not described in 'batadv_mcast_forw_push_dest'
./net/batman-adv/multicast_forw.c:398: warning: Function parameter or member
'bat_priv' not described in 'batadv_mcast_forw_push_tvlvs'