mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
This cleanup patchset includes the following patches:
- bump version strings, by Simon Wunderlich - use skb_crc32c() instead of skb_seq_read(), by Sven Eckelmann -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEE1ilQI7G+y+fdhnrfoSvjmEKSnqEFAmj7Q3wWHHN3QHNpbW9u d3VuZGVybGljaC5kZQAKCRChK+OYQpKeoYJoD/9rfjRqi18i4UrTpKKddPcxHnP0 zzQoXiEc5AI+P50ciBch8fSIu4lPCJGHJZoOHtW3d0QRXkEE+wX71LyCALc4Xn9Q wWC6DqMK9RsnXxGl1aqWjtlk9XO9rK+UlT/QpJKnQmtrTKAvJj2L+6dwtdPOyI75 pHip1OPK3WVs+tGOhsWL7POn8ZAKhnSu+3j/eb8wTnwValP+dBpTUuo84IZ39o5L PSO+dJVTdmetg7rY2JxObvivqiJeI8yB2AJyGN5LpyknTz+o4VtU7VBD1iCFTfr/ fv7cx8uN+ldOIxovAVtmvQipM4xea762LQrA1OUsotc/9c3nM8yJc88q3kSI95Zc ECALDDYqIM6rHvmXkaIcH2Ni+zOGnbk+ojHt/YjJSrxQbK4W/TvqTLPAPnBNq0hj B9jPzpnv3thV1boYHvXVhUfXmhGM2h67SSN/67v8cuGQX1EnOJZNQBlXk1u4WcPp stYfSllrMYLguc+Wq/ceUFz/aRsdwzZqq8OeOlFYc16Ws32RfB5Kh5/+O3rLxK4v 41XsBRCEVUYXRqq5NMONORV8nFBd7Uwjtp7HxRmxDQGVhHNgQZMWYmHPbpXzK1m0 7HZuZOsDkvsRhcK/WX31ox0O+QTmIkl8YQvAx9By+ff2pk51tK4PHsTsmElVOMJJ OqQxVp3UaX7GaL+6lA== =Hqjg -----END PGP SIGNATURE----- Merge tag 'batadv-next-pullrequest-20251024' of https://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - use skb_crc32c() instead of skb_seq_read(), by Sven Eckelmann * tag 'batadv-next-pullrequest-20251024' of https://git.open-mesh.org/linux-merge: batman-adv: use skb_crc32c() instead of skb_seq_read() batman-adv: Start new development cycle ==================== Link: https://patch.msgid.link/20251024092315.232636-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
bbfa5e7c8d
|
|
@ -35,6 +35,7 @@ config BATMAN_ADV_BLA
|
|||
bool "Bridge Loop Avoidance"
|
||||
depends on BATMAN_ADV && INET
|
||||
select CRC16
|
||||
select NET_CRC32C
|
||||
default y
|
||||
help
|
||||
This option enables BLA (Bridge Loop Avoidance), a mechanism
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include <linux/compiler.h>
|
||||
#include <linux/container_of.h>
|
||||
#include <linux/crc16.h>
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/etherdevice.h>
|
||||
|
|
@ -1585,45 +1584,11 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_skb_crc32() - calculate CRC32 of the whole packet and skip bytes in
|
||||
* the header
|
||||
* @skb: skb pointing to fragmented socket buffers
|
||||
* @payload_ptr: Pointer to position inside the head buffer of the skb
|
||||
* marking the start of the data to be CRC'ed
|
||||
*
|
||||
* payload_ptr must always point to an address in the skb head buffer and not to
|
||||
* a fragment.
|
||||
*
|
||||
* Return: big endian crc32c of the checksummed data
|
||||
*/
|
||||
static __be32 batadv_skb_crc32(struct sk_buff *skb, u8 *payload_ptr)
|
||||
{
|
||||
unsigned int to = skb->len;
|
||||
unsigned int consumed = 0;
|
||||
struct skb_seq_state st;
|
||||
unsigned int from;
|
||||
unsigned int len;
|
||||
const u8 *data;
|
||||
u32 crc = 0;
|
||||
|
||||
from = (unsigned int)(payload_ptr - skb->data);
|
||||
|
||||
skb_prepare_seq_read(skb, from, to, &st);
|
||||
while ((len = skb_seq_read(consumed, &data, &st)) != 0) {
|
||||
crc = crc32c(crc, data, len);
|
||||
consumed += len;
|
||||
}
|
||||
|
||||
return htonl(crc);
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_bla_check_duplist() - Check if a frame is in the broadcast dup.
|
||||
* @bat_priv: the bat priv with all the mesh interface information
|
||||
* @skb: contains the multicast packet to be checked
|
||||
* @payload_ptr: pointer to position inside the head buffer of the skb
|
||||
* marking the start of the data to be CRC'ed
|
||||
* @payload_offset: offset in the skb, marking the start of the data to be CRC'ed
|
||||
* @orig: originator mac address, NULL if unknown
|
||||
*
|
||||
* Check if it is on our broadcast list. Another gateway might have sent the
|
||||
|
|
@ -1638,16 +1603,18 @@ static __be32 batadv_skb_crc32(struct sk_buff *skb, u8 *payload_ptr)
|
|||
* Return: true if a packet is in the duplicate list, false otherwise.
|
||||
*/
|
||||
static bool batadv_bla_check_duplist(struct batadv_priv *bat_priv,
|
||||
struct sk_buff *skb, u8 *payload_ptr,
|
||||
struct sk_buff *skb, int payload_offset,
|
||||
const u8 *orig)
|
||||
{
|
||||
struct batadv_bcast_duplist_entry *entry;
|
||||
bool ret = false;
|
||||
int payload_len;
|
||||
int i, curr;
|
||||
__be32 crc;
|
||||
u32 crc;
|
||||
|
||||
/* calculate the crc ... */
|
||||
crc = batadv_skb_crc32(skb, payload_ptr);
|
||||
payload_len = skb->len - payload_offset;
|
||||
crc = skb_crc32c(skb, payload_offset, payload_len, 0);
|
||||
|
||||
spin_lock_bh(&bat_priv->bla.bcast_duplist_lock);
|
||||
|
||||
|
|
@ -1727,7 +1694,7 @@ static bool batadv_bla_check_duplist(struct batadv_priv *bat_priv,
|
|||
static bool batadv_bla_check_ucast_duplist(struct batadv_priv *bat_priv,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
return batadv_bla_check_duplist(bat_priv, skb, (u8 *)skb->data, NULL);
|
||||
return batadv_bla_check_duplist(bat_priv, skb, 0, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1745,12 +1712,10 @@ bool batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
|
|||
struct sk_buff *skb)
|
||||
{
|
||||
struct batadv_bcast_packet *bcast_packet;
|
||||
u8 *payload_ptr;
|
||||
|
||||
bcast_packet = (struct batadv_bcast_packet *)skb->data;
|
||||
payload_ptr = (u8 *)(bcast_packet + 1);
|
||||
|
||||
return batadv_bla_check_duplist(bat_priv, skb, payload_ptr,
|
||||
return batadv_bla_check_duplist(bat_priv, skb, sizeof(*bcast_packet),
|
||||
bcast_packet->orig);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#define BATADV_DRIVER_DEVICE "batman-adv"
|
||||
|
||||
#ifndef BATADV_SOURCE_VERSION
|
||||
#define BATADV_SOURCE_VERSION "2025.4"
|
||||
#define BATADV_SOURCE_VERSION "2025.5"
|
||||
#endif
|
||||
|
||||
/* B.A.T.M.A.N. parameters */
|
||||
|
|
|
|||
|
|
@ -734,7 +734,7 @@ struct batadv_bcast_duplist_entry {
|
|||
u8 orig[ETH_ALEN];
|
||||
|
||||
/** @crc: crc32 checksum of broadcast payload */
|
||||
__be32 crc;
|
||||
u32 crc;
|
||||
|
||||
/** @entrytime: time when the broadcast packet was received */
|
||||
unsigned long entrytime;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user