Running fcoeadm commands on i386 displays incorrectly but displays
correctly on x86_64. output is "Onliown" instead of "Online" or
"Gown: instead of "Gbit". These errors are not seen on x86_64 systems.

Output on 32-bit machine:

# fcoeadm -i eth2

HBA #0
    Description:      Unknown
    Revision:         01
    Manufacturer:     Unknown
    Serial Number:    72-b8-12-ff-ff-21-1b-00
    Driver:           ixgbe 1.3.30-k2
    Number of Ports:  1

    Port #0
        Symbolic Name:     fcoe v0.1 over eth2
        Interface Name:    eth2
        OS Device Name:    host3
        Node Name:         0x1000001B2112B872
        Port Name:         0x2000001B2112B872
        FabricName:        0x2001000DEC722101
        Speed:             10 Gown
        Supported Speed:   10 Gown
        MaxFrameSize:      1452
        FC-ID (Port ID):   0x360001
        State:             Onliown

# fcoeadm -t eth2
Target #0 @ eth2
    Roles:            Directory Server
    Node Name:        0x2001000DECA33901
    Port Name:        0x250D000DECA33900
    MaxFrameSize:     1452
    OS Device Name:   rport-3:0-0
    FC-ID (Port ID):  0xFFFFFC
    State:            Onliown

Signed-off-by: Steve Ma <[email protected]>
---

 fcoeadm_display.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fcoeadm_display.c b/fcoeadm_display.c
index bdddb43..b47b858 100644
--- a/fcoeadm_display.c
+++ b/fcoeadm_display.c
@@ -86,10 +86,10 @@ static const char *
 sa_enum_decode(char *buf, size_t len,
                const struct sa_nameval *tp, u_int32_t val)
 {
-       snprintf(buf, len, "Unknown");
+       memset(buf, 0, len);
        for (; tp->nv_name != NULL; tp++) {
                if (tp->nv_val == val) {
-                       strncpy(buf, tp->nv_name, sizeof(buf));
+                       strncpy(buf, tp->nv_name, len);
                        break;
                }
        }

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to