[3/3] batman-experimental: Correct gw_speed down bit mask

Message ID 1275519516-21394-3-git-send-email-sven.eckelmann@gmx.de (mailing list archive)
State Rejected, archived
Headers

Commit Message

Sven Eckelmann June 2, 2010, 10:58 p.m. UTC
  We want to get bits .OOOO... and not as the mask would suggest .OOOOO..
when we decode the encoded bits for the download part of the gateway
speed.

Reported-By: Bill Meier <wmeier@newsguy.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Cc: Axel Neumann <neumann@cgws.de>
---
 batman-experimental/posix/tunnel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
  

Patch

diff --git a/batman-experimental/posix/tunnel.c b/batman-experimental/posix/tunnel.c
index 8911dcc..c1aba5c 100644
--- a/batman-experimental/posix/tunnel.c
+++ b/batman-experimental/posix/tunnel.c
@@ -466,7 +466,7 @@  static int8_t set_tun_addr( int32_t fd, uint32_t tun_addr, char *tun_dev ) {
 static void get_gw_speeds( unsigned char class, int *down, int *up ) {
 
 	char sbit    = (class&0x80)>>7;
-	char dpart   = (class&0x7C)>>3;
+	char dpart   = (class&0x78)>>3;
 	char upart   = (class&0x07);
 
 	*down= 32*(sbit+2)*(1<<dpart);