virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Jens Osterkamp <jens@linux.vnet.ibm.com>
To: e1000-eedc@lists.sourceforge.net,
	virtualization@lists.linux-foundation.org, evb@yahoogroups.com
Cc: chrisw@redhat.com, Jens Osterkamp <jens@linux.vnet.ibm.com>
Subject: [PATCH 04/17] BUGFIX: check in correct positions
Date: Fri, 23 Jul 2010 12:34:20 +0200	[thread overview]
Message-ID: <1279881273-10261-5-git-send-email-jens@linux.vnet.ibm.com> (raw)
In-Reply-To: <1279881273-10261-1-git-send-email-jens@linux.vnet.ibm.com>

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 <jens@linux.vnet.ibm.com>
---
 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

  parent reply	other threads:[~2010-07-23 10:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23 10:34 implementation of IEEE 802.1Qbg in lldpad Jens Osterkamp
2010-07-23 10:34 ` [PATCH 01/17] consolidation of MIN and MAX macros in common.h Jens Osterkamp
2010-07-23 10:34 ` [PATCH 02/17] implementation of IEEE 802.1Qbg in lldpad, part 1 Jens Osterkamp
2010-07-23 10:34 ` [PATCH 03/17] support for getting and setting EVB TLV parameters Jens Osterkamp
2010-07-23 10:34 ` Jens Osterkamp [this message]
2010-07-23 10:34 ` [PATCH 05/17] remove VDPL and proper config save and restore Jens Osterkamp
2010-07-23 10:34 ` [PATCH 06/17] BUGFIX: agree to max of rte Jens Osterkamp
2010-07-23 10:34 ` [PATCH 07/17] BUGFIX: avoid compile warnings Jens Osterkamp
2010-07-23 10:34 ` [PATCH 08/17] BUGFIX: fix formatting in include/lldp_evb_clif.h Jens Osterkamp
2010-07-23 10:34 ` [PATCH 09/17] BUGFIX: check for existence of ifup Jens Osterkamp
2010-07-23 10:34 ` [PATCH 10/17] allow to set both supported forwarding modes Jens Osterkamp
2010-07-23 10:34 ` [PATCH 11/17] ECP implementation Jens Osterkamp
2010-08-03  6:36   ` [E1000-eedc] " John Fastabend
2010-08-03 12:02     ` Jens Osterkamp
2010-07-23 10:34 ` [PATCH 12/17] implementation of vdp Jens Osterkamp
2010-07-23 10:34 ` [PATCH 13/17] VDP commandline interface Jens Osterkamp
2010-07-23 10:34 ` [PATCH 14/17] add libnl dependency to configure.ac Jens Osterkamp
2010-07-23 10:34 ` [PATCH 15/17] use connect instead of bind Jens Osterkamp
2010-07-23 10:34 ` [PATCH 16/17] lldpad support for libvirt netlink message Jens Osterkamp
2010-08-03  7:52   ` [E1000-eedc] " John Fastabend
2010-08-03 11:59     ` Jens Osterkamp
2010-07-23 10:34 ` [PATCH 17/17] do not use macv[tap/lan] interfaces as ports Jens Osterkamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279881273-10261-5-git-send-email-jens@linux.vnet.ibm.com \
    --to=jens@linux.vnet.ibm.com \
    --cc=chrisw@redhat.com \
    --cc=e1000-eedc@lists.sourceforge.net \
    --cc=evb@yahoogroups.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).