Thread (22 messages) read the whole thread 22 messages, 2 authors, 2010-08-03
STALE5840d

[PATCH 04/17] BUGFIX: check in correct positions

From: Jens Osterkamp <hidden>
Date: 2010-07-23 10:34:20
Subsystem: the rest · Maintainer: Linus Torvalds

There was a bug in the print function for EVB TLVs that would
cause the wrong values to be printed.
This patch corrects it and adds some debug statement to evb_print_cfg_tlv.

Signed-off-by: Jens Osterkamp <redacted>
---
 lldp_evb_clif.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lldp_evb_clif.c b/lldp_evb_clif.c
index d1773fe..d450f4b 100644
--- a/lldp_evb_clif.c
+++ b/lldp_evb_clif.c
@@ -108,7 +108,7 @@ void evb_print_cfg_tlv(u16 len, char *info)
 	}
 
 	if (!hexstr2bin(info, &smode, sizeof(smode))) {
-		printf("supported forwarding mode:");
+		printf("supported forwarding mode: (0x%02hhx)", smode);
 
 		if (smode & LLDP_EVB_CAPABILITY_FORWARD_RELAXEDRELAY)
 			printf(" reflective relay");
@@ -122,7 +122,7 @@ void evb_print_cfg_tlv(u16 len, char *info)
 	}
 
 	if (!hexstr2bin(info+2, &scap, sizeof(scap))) {
-		printf("\tsupported capabilities:");
+		printf("\tsupported capabilities: (0x%02hhx)", scap);
 
 		if ( scap & LLDP_EVB_CAPABILITY_PROTOCOL_RTE)
 		     printf(" RTE");
@@ -141,8 +141,8 @@ void evb_print_cfg_tlv(u16 len, char *info)
 		printf("Unable to decode scap !\n");
 	}
 
-	if (!hexstr2bin(info, &cmode, sizeof(cmode))) {
-		printf("\tconfigured forwarding mode:");
+	if (!hexstr2bin(info+4, &cmode, sizeof(cmode))) {
+		printf("\tconfigured forwarding mode: (0x%02hhx)", cmode);
 
 		if (cmode & LLDP_EVB_CAPABILITY_FORWARD_RELAXEDRELAY)
 			printf(" reflective relay");
@@ -155,8 +155,8 @@ void evb_print_cfg_tlv(u16 len, char *info)
 		printf("Unable to decode cmode !\n");
 	}
 
-	if (!hexstr2bin(info+4, &ccap, sizeof(ccap))) {
-		printf("\tconfigured capabilities:");
+	if (!hexstr2bin(info+6, &ccap, sizeof(ccap))) {
+		printf("\tconfigured capabilities: (0x%02hhx)", ccap);
 
 		if ( ccap & LLDP_EVB_CAPABILITY_PROTOCOL_RTE)
 		     printf(" RTE");
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help