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 --- batman/batman.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/batman/batman.c b/batman/batman.c index 4374af5..ab689b2 100644 --- a/batman/batman.c +++ b/batman/batman.c @@ -482,7 +482,7 @@ void update_gw_list(struct orig_node *orig_node, uint8_t new_gwflags, uint16_t g void get_gw_speeds(unsigned char gw_class, int *down, int *up) { char sbit = (gw_class & 0x80) >> 7; - char dpart = (gw_class & 0x7C) >> 3; + char dpart = (gw_class & 0x78) >> 3; char upart = (gw_class & 0x07);
*down = 32 * (sbit + 2) * (1 << dpart);
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 --- batman-adv-kernelland/gateway_common.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/batman-adv-kernelland/gateway_common.c b/batman-adv-kernelland/gateway_common.c index d542306..270cf3d 100644 --- a/batman-adv-kernelland/gateway_common.c +++ b/batman-adv-kernelland/gateway_common.c @@ -63,7 +63,7 @@ static void kbit_to_gw_srv_class(int down, int up, long *gw_srv_class) void gw_srv_class_to_kbit(uint8_t gw_srv_class, int *down, int *up) { char sbit = (gw_srv_class & 0x80) >> 7; - char dpart = (gw_srv_class & 0x7C) >> 3; + char dpart = (gw_srv_class & 0x78) >> 3; char upart = (gw_srv_class & 0x07);
if (!gw_srv_class) {
Thanks, committed in r1690.
On Thu, Jun 03, 2010 at 12:58:35AM +0200, Sven Eckelmann wrote:
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
batman-adv-kernelland/gateway_common.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/batman-adv-kernelland/gateway_common.c b/batman-adv-kernelland/gateway_common.c index d542306..270cf3d 100644 --- a/batman-adv-kernelland/gateway_common.c +++ b/batman-adv-kernelland/gateway_common.c @@ -63,7 +63,7 @@ static void kbit_to_gw_srv_class(int down, int up, long *gw_srv_class) void gw_srv_class_to_kbit(uint8_t gw_srv_class, int *down, int *up) { char sbit = (gw_srv_class & 0x80) >> 7;
- char dpart = (gw_srv_class & 0x7C) >> 3;
char dpart = (gw_srv_class & 0x78) >> 3; char upart = (gw_srv_class & 0x07);
if (!gw_srv_class) {
-- 1.7.1
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(-)
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);
Thanks, applied in svn r1691.
On Thu, Jun 03, 2010 at 12:58:34AM +0200, Sven Eckelmann wrote:
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
batman/batman.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/batman/batman.c b/batman/batman.c index 4374af5..ab689b2 100644 --- a/batman/batman.c +++ b/batman/batman.c @@ -482,7 +482,7 @@ void update_gw_list(struct orig_node *orig_node, uint8_t new_gwflags, uint16_t g void get_gw_speeds(unsigned char gw_class, int *down, int *up) { char sbit = (gw_class & 0x80) >> 7;
- char dpart = (gw_class & 0x7C) >> 3;
char dpart = (gw_class & 0x78) >> 3; char upart = (gw_class & 0x07);
*down = 32 * (sbit + 2) * (1 << dpart);
-- 1.7.1
b.a.t.m.a.n@lists.open-mesh.org