Commit 39620a35 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'batadv-next-pullrequest-20231115' of git://git.open-mesh.org/linux-merge



This feature/cleanup patchset includes the following patches:

 - bump version strings, by Simon Wunderlich

 - Implement new multicast packet type, including its transmission,
   forwarding and parsing, by Linus Lüssing (3 patches)

 - Switch to new headers for sprintf and array size,
   by Sven Eckelmann (2 patches)

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 72a813a4 c3ed16a6
Loading
Loading
Loading
Loading
+39 −6
Original line number Diff line number Diff line
@@ -116,6 +116,9 @@ enum batadv_icmp_packettype {
 * 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
 * @BATADV_MCAST_HAVE_MC_PTYPE_CAPA: we can parse, receive and forward
 * batman-adv multicast packets with a multicast tracker TVLV. And all our
 * hard interfaces have an MTU of at least 1280 bytes.
 */
enum batadv_mcast_flags {
	BATADV_MCAST_WANT_ALL_UNSNOOPABLES	= 1UL << 0,
@@ -123,6 +126,7 @@ enum batadv_mcast_flags {
	BATADV_MCAST_WANT_ALL_IPV6		= 1UL << 2,
	BATADV_MCAST_WANT_NO_RTR4		= 1UL << 3,
	BATADV_MCAST_WANT_NO_RTR6		= 1UL << 4,
	BATADV_MCAST_HAVE_MC_PTYPE_CAPA		= 1UL << 5,
};

/* tt data subtypes */
@@ -174,6 +178,7 @@ enum batadv_bla_claimframe {
 * @BATADV_TVLV_TT: translation table tvlv
 * @BATADV_TVLV_ROAM: roaming advertisement tvlv
 * @BATADV_TVLV_MCAST: multicast capability tvlv
 * @BATADV_TVLV_MCAST_TRACKER: multicast tracker tvlv
 */
enum batadv_tvlv_type {
	BATADV_TVLV_GW			= 0x01,
@@ -182,6 +187,7 @@ enum batadv_tvlv_type {
	BATADV_TVLV_TT			= 0x04,
	BATADV_TVLV_ROAM		= 0x05,
	BATADV_TVLV_MCAST		= 0x06,
	BATADV_TVLV_MCAST_TRACKER	= 0x07,
};

#pragma pack(2)
@@ -487,6 +493,25 @@ struct batadv_bcast_packet {
	 */
};

/**
 * struct batadv_mcast_packet - multicast packet for network payload
 * @packet_type: batman-adv packet type, part of the general header
 * @version: batman-adv protocol version, part of the general header
 * @ttl: time to live for this packet, part of the general header
 * @reserved: reserved byte for alignment
 * @tvlv_len: length of the appended tvlv buffer (in bytes)
 */
struct batadv_mcast_packet {
	__u8 packet_type;
	__u8 version;
	__u8 ttl;
	__u8 reserved;
	__be16 tvlv_len;
	/* "4 bytes boundary + 2 bytes" long to make the payload after the
	 * following ethernet header again 4 bytes boundary aligned
	 */
};

/**
 * struct batadv_coded_packet - network coded packet
 * @packet_type: batman-adv packet type, part of the general header
@@ -628,6 +653,14 @@ struct batadv_tvlv_mcast_data {
	__u8 reserved[3];
};

/**
 * struct batadv_tvlv_mcast_tracker - payload of a multicast tracker tvlv
 * @num_dests: number of subsequent destination originator MAC addresses
 */
struct batadv_tvlv_mcast_tracker {
	__be16	num_dests;
};

#pragma pack()

#endif /* _UAPI_LINUX_BATADV_PACKET_H_ */
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ batman-adv-y += hash.o
batman-adv-$(CONFIG_BATMAN_ADV_DEBUG) += log.o
batman-adv-y += main.o
batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast.o
batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast_forw.o
batman-adv-y += netlink.o
batman-adv-$(CONFIG_BATMAN_ADV_NC) += network-coding.o
batman-adv-y += originator.o
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
#include <linux/if_vlan.h>
#include <linux/jhash.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/list.h>
#include <linux/lockdep.h>
@@ -31,6 +30,7 @@
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/sprintf.h>
#include <linux/stddef.h>
#include <linux/string.h>
#include <linux/workqueue.h>
+1 −7
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@

#include "hard-interface.h"
#include "originator.h"
#include "routing.h"
#include "send.h"

/**
@@ -351,18 +350,14 @@ bool batadv_frag_skb_fwd(struct sk_buff *skb,
			 struct batadv_orig_node *orig_node_src)
{
	struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface);
	struct batadv_orig_node *orig_node_dst;
	struct batadv_neigh_node *neigh_node = NULL;
	struct batadv_frag_packet *packet;
	u16 total_size;
	bool ret = false;

	packet = (struct batadv_frag_packet *)skb->data;
	orig_node_dst = batadv_orig_hash_find(bat_priv, packet->dest);
	if (!orig_node_dst)
		goto out;

	neigh_node = batadv_find_router(bat_priv, orig_node_dst, recv_if);
	neigh_node = batadv_orig_to_router(bat_priv, packet->dest, recv_if);
	if (!neigh_node)
		goto out;

@@ -381,7 +376,6 @@ bool batadv_frag_skb_fwd(struct sk_buff *skb,
	}

out:
	batadv_orig_node_put(orig_node_dst);
	batadv_neigh_node_put(neigh_node);
	return ret;
}
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/list.h>
#include <linux/lockdep.h>
@@ -29,6 +28,7 @@
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/sprintf.h>
#include <linux/stddef.h>
#include <linux/udp.h>
#include <net/sock.h>
Loading