From: Hannes Reinecke Date: Tue, 23 Nov 2021 07:19:20 +0000 (+0100) Subject: fabrics: do not print 'unrecognized' address family for loop X-Git-Tag: v2.0-rc0~36^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bbce560ff4205f61fadfc8905dfd02df78d69fbc;p=users%2Fsagi%2Fnvme-cli.git fabrics: do not print 'unrecognized' address family for loop fabrics implementations like 'loop' do not have a transport address, and consequently the address family value doesn't make any sense here. So do not try to translate the address family to a printable string if the address itself is empty. Signed-off-by: Hannes Reinecke --- diff --git a/fabrics.c b/fabrics.c index e08ed494..176b5093 100644 --- a/fabrics.c +++ b/fabrics.c @@ -130,7 +130,9 @@ static void print_discovery_log(struct nvmf_discovery_log *log, int numrec) printf("=====Discovery Log Entry %d======\n", i); printf("trtype: %s\n", nvmf_trtype_str(e->trtype)); - printf("adrfam: %s\n", nvmf_adrfam_str(e->adrfam)); + printf("adrfam: %s\n", + e->traddr && strlen(e->traddr) ? + nvmf_adrfam_str(e->adrfam): ""); printf("subtype: %s\n", nvmf_subtype_str(e->subtype)); printf("treq: %s\n", nvmf_treq_str(e->treq)); printf("portid: %d\n", e->portid);