[Open-FCoE] [RFC PATCH] fcoe-utils: Fix the interface name in the fcoeadm target display

Steve Ma steve.ma at intel.com
Wed Apr 15 19:48:06 UTC 2009


The interface name displayed by the command "fcoeadm -t" contains
junk characters. This fix is to get the interface name from the
port symbolic name string in the port attribute structure.
---

 fcoeadm_display.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fcoeadm_display.c b/fcoeadm_display.c
index 39293cb..0e5cb88 100644
--- a/fcoeadm_display.c
+++ b/fcoeadm_display.c
@@ -261,14 +261,17 @@ show_port_info(int hba_index, int lp_index,
 static void
 show_target_info(int hba_index, int lp_index, int rp_index,
 		HBA_ADAPTERATTRIBUTES *hba_info,
+		HBA_PORTATTRIBUTES *lp_info,
 		HBA_PORTATTRIBUTES *rp_info)
 {
 	char buf[256];
 	u_int32_t tgt_id;
+	char *ifname;
 	int rc;
 
-	printf("Target #%d @ %s\n",
-				rp_index, hba_info->NodeSymbolicName + 5);
+	ifname = strstr(lp_info->PortSymbolicName, "eth");
+	printf("Target #%d @ %s\n", rp_index,
+				    ifname?ifname:"local port");
 
 	rc = sa_sys_read_line(rp_info->OSDeviceName, "roles", buf, sizeof(buf));
 	printf("    Roles:            %s\n", buf);
@@ -1329,7 +1332,7 @@ display_target_info(struct opt_info *opt_info)
 
 				show_target_info(hba_index, lp_index,
 						 rp_index, &hba_attrs,
-						 &rport_attrs);
+						 &port_attrs, &rport_attrs);
 
 				scan_device_map(hba_handle, &hba_attrs,
 						&port_attrs, &rport_attrs,




More information about the devel mailing list