aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/aggregation.c
diff options
context:
space:
mode:
authorSimon Wunderlich <siwu@hrz.tu-chemnitz.de>2010-06-22 01:25:51 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-06-22 14:05:06 -0700
commitcf2d72ec5c66ac3ebe9d28c3d88314a958cc180e (patch)
tree186fd2f2f9bc7d08f4e25d7d503cd9192997b0a3 /drivers/staging/batman-adv/aggregation.c
parentStaging: batman-adv: Add release information for version 2010.0.0 (diff)
downloadlinux-dev-cf2d72ec5c66ac3ebe9d28c3d88314a958cc180e.tar.xz
linux-dev-cf2d72ec5c66ac3ebe9d28c3d88314a958cc180e.zip
Staging: batman-adv: 32bit sequence number and TTL for broadcasts
This patch changes the sequence number range from 8 or 16 bit to 32 bit. This should avoid problems with the sequence number sliding window algorithm which we had seen in the past for broadcast floods or malicious packet injections. We can not assure 100% security with this patch, but it is quite an improvement over the old 16 bit sequence numbers: * expected window size can be increased (4096 -> 65536) * 64k packets in the right order would now be needed to cause a loop, which seems practically impossible. Furthermore, a TTL field has been added to the broadcast packet type, just to make sure. These changes required to increase the compatibility level once again. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> [sven.eckelmann@gmx.de: Change atomic64_* back to atomic_*, Rework on top of current version] Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/aggregation.c')
-rw-r--r--drivers/staging/batman-adv/aggregation.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/batman-adv/aggregation.c b/drivers/staging/batman-adv/aggregation.c
index ce8b8a6e5ae6..3a5c3499ca06 100644
--- a/drivers/staging/batman-adv/aggregation.c
+++ b/drivers/staging/batman-adv/aggregation.c
@@ -252,9 +252,9 @@ void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
while (aggregated_packet(buff_pos, packet_len,
batman_packet->num_hna)) {
- /* network to host order for our 16bit seqno, and the
+ /* network to host order for our 32bit seqno, and the
orig_interval. */
- batman_packet->seqno = ntohs(batman_packet->seqno);
+ batman_packet->seqno = ntohl(batman_packet->seqno);
hna_buff = packet_buff + buff_pos + BAT_PACKET_LEN;
receive_bat_packet(ethhdr, batman_packet,