Blame SOURCES/open-lldp-v1.0.1-28-fix-oid-display.patch

74731f
From cf3f54d1883e5bc23e4c4006a63e1dde88684013 Mon Sep 17 00:00:00 2001
74731f
From: Aaron Conole <aconole@redhat.com>
74731f
Date: Thu, 21 Jun 2018 13:28:48 -0400
74731f
Subject: [PATCH] basman_clif: print the OID properly
74731f
74731f
When invoking the lldp tool to view the management information, the display
74731f
for the OID is printed as the actual binary bits, rather than the
74731f
OID dotted-notation form.
74731f
74731f
This change will display the OID as expected.
74731f
74731f
Signed-off-by: Aaron Conole <aconole@redhat.com>
74731f
---
74731f
 lldp_basman_clif.c | 18 ++++++++++++++++--
74731f
 1 file changed, 16 insertions(+), 2 deletions(-)
74731f
74731f
diff --git a/lldp_basman_clif.c b/lldp_basman_clif.c
74731f
index 7dba9d2..abd152d 100644
74731f
--- a/lldp_basman_clif.c
74731f
+++ b/lldp_basman_clif.c
74731f
@@ -272,8 +272,15 @@ void print_mng_addr(u16 len, char *info)
74731f
 		memset(buf, 0, sizeof(buf));
74731f
 		if (hexstr2bin(info+offset, (u8 *)&buf, oidlen))
74731f
 			printf("\tOID: Error parsing OID\n");
74731f
-		else
74731f
-			printf("\tOID: %s\n", buf);
74731f
+		else {
74731f
+			printf("\tOID: 0.");
74731f
+			for (i = 0; i < oidlen; ++i) {
74731f
+				printf("%d", buf[i]);
74731f
+				if (i != (oidlen - 1))
74731f
+					printf(".");
74731f
+			}
74731f
+			printf("\n");
74731f
+		}
74731f
 	} else if (oidlen > 128) {
74731f
 		printf("\tOID: Invalid length = %d\n", oidlen);
74731f
 	}
74731f
@@ -310,3 +317,10 @@ u32 basman_lookup_tlv_name(char *tlvid_str)
74731f
 	}
74731f
 	return INVALID_TLVID;
74731f
 }
74731f
+
74731f
+/* Local Variables:    */
74731f
+/* c-indent-level: 8   */
74731f
+/* c-basic-offset: 8   */
74731f
+/* tab-width: 8        */
74731f
+/* indent-tabs-mode: t */
74731f
+/* End:                */
74731f
-- 
74731f
2.14.3