[3/3] batman-adv: process OGMs bigger than MAX_AGGREGATION_BYTES

Message ID 1287157417-15369-3-git-send-email-lindner_marek@yahoo.de (mailing list archive)
State Accepted, archived
Headers

Commit Message

Marek Lindner Oct. 15, 2010, 3:43 p.m. UTC
  Reported-by: Sam Yeung <sam.cwyeung@gmail.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 batman-adv/aggregation.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
  

Patch

diff --git a/batman-adv/aggregation.c b/batman-adv/aggregation.c
index 16b268e..08624d4 100644
--- a/batman-adv/aggregation.c
+++ b/batman-adv/aggregation.c
@@ -257,9 +257,7 @@  void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
 
 	batman_packet = (struct batman_packet *)packet_buff;
 
-	while (aggregated_packet(buff_pos, packet_len,
-				 batman_packet->num_hna)) {
-
+	do {
 		/* network to host order for our 32bit seqno, and the
 		   orig_interval. */
 		batman_packet->seqno = ntohl(batman_packet->seqno);
@@ -272,5 +270,6 @@  void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
 		buff_pos += BAT_PACKET_LEN + hna_len(batman_packet);
 		batman_packet = (struct batman_packet *)
 			(packet_buff + buff_pos);
-	}
+	} while (aggregated_packet(buff_pos, packet_len,
+				   batman_packet->num_hna));
 }