]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
batman-adv: Ignore own maximum aggregation size during RX
authorSven Eckelmann <sven@narfation.org>
Sun, 2 Feb 2025 16:04:13 +0000 (17:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Mar 2025 20:59:01 +0000 (21:59 +0100)
commit 548b0c5de7619ef53bbde5590700693f2f6d2a56 upstream.

An OGMv1 and OGMv2 packet receive processing were not only limited by the
number of bytes in the received packet but also by the nodes maximum
aggregation packet size limit. But this limit is relevant for TX and not
for RX. It must not be enforced by batadv_(i)v_ogm_aggr_packet to avoid
loss of information in case of a different limit for sender and receiver.

This has a minor side effect for B.A.T.M.A.N. IV because the
batadv_iv_ogm_aggr_packet is also used for the preprocessing for the TX.
But since the aggregation code itself will not allow more than
BATADV_MAX_AGGREGATION_BYTES bytes, this check was never triggering (in
this context) prior of removing it.

Cc: stable@vger.kernel.org
Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol")
Fixes: 9323158ef9f4 ("batman-adv: OGMv2 - implement originators logic")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/batman-adv/bat_iv_ogm.c
net/batman-adv/bat_v_ogm.c

index 7f6a7c96ac9222c245b2103a284b30f5e2c0cfc2..02e084b440538165a7f7deb3bfa39b5ae0299d8b 100644 (file)
@@ -325,8 +325,7 @@ batadv_iv_ogm_aggr_packet(int buff_pos, int packet_len,
        /* check if there is enough space for the optional TVLV */
        next_buff_pos += ntohs(ogm_packet->tvlv_len);
 
-       return (next_buff_pos <= packet_len) &&
-              (next_buff_pos <= BATADV_MAX_AGGREGATION_BYTES);
+       return next_buff_pos <= packet_len;
 }
 
 /* send a batman ogm to a given interface */
index 9f4815f4c8e899d8b8f359df6a72b73fc9671a2b..deef817b28f0aeb6636535131d7d4565bbf94c6a 100644 (file)
@@ -840,8 +840,7 @@ batadv_v_ogm_aggr_packet(int buff_pos, int packet_len,
        /* check if there is enough space for the optional TVLV */
        next_buff_pos += ntohs(ogm2_packet->tvlv_len);
 
-       return (next_buff_pos <= packet_len) &&
-              (next_buff_pos <= BATADV_MAX_AGGREGATION_BYTES);
+       return next_buff_pos <= packet_len;
 }
 
 /**