Skip to content

Commit

Permalink
batman-adv: Ignore own maximum aggregation size during RX
Browse files Browse the repository at this point in the history
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: c6c8fea ("net: Add batman-adv meshing protocol")
Fixes: 9323158 ("batman-adv: OGMv2 - implement originators logic")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
  • Loading branch information
Sven Eckelmann authored and Simon Wunderlich committed Feb 8, 2025
1 parent f4c9c2c commit 548b0c5
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions net/batman-adv/bat_iv_ogm.c
Original file line number Diff line number Diff line change
@@ -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 */
3 changes: 1 addition & 2 deletions net/batman-adv/bat_v_ogm.c
Original file line number Diff line number Diff line change
@@ -839,8 +839,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;
}

/**

0 comments on commit 548b0c5

Please sign in to comment.