From 00fc7817bc175b27cfe87e7ccb28599b93679296 Mon Sep 17 00:00:00 2001 From: "K. Y. Srinivasan" Date: Thu, 25 Oct 2012 14:15:50 -0700 Subject: [PATCH] --- yaml --- r: 336953 b: refs/heads/master c: 3321e738d6f0a82b2c19f9d5890f304dab1e5357 h: refs/heads/master i: 336951: 6235cfe0e0dc98e449818e120a7374216f556975 v: v3 --- [refs] | 2 +- trunk/tools/hv/hv_kvp_daemon.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 1170645c7619..36bf5bd71fb1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f426a36cecfea2cfd69c28ca5ba4f4bfae913f63 +refs/heads/master: 3321e738d6f0a82b2c19f9d5890f304dab1e5357 diff --git a/trunk/tools/hv/hv_kvp_daemon.c b/trunk/tools/hv/hv_kvp_daemon.c index 6c7bcb9932cb..13c2a142331d 100644 --- a/trunk/tools/hv/hv_kvp_daemon.c +++ b/trunk/tools/hv/hv_kvp_daemon.c @@ -43,6 +43,7 @@ #include #include #include +#include /* * KVP protocol: The user mode component first registers with the @@ -882,7 +883,7 @@ static int kvp_process_ip_address(void *addrp, addr_length = INET6_ADDRSTRLEN; } - if ((length - *offset) < addr_length + 1) + if ((length - *offset) < addr_length + 2) return HV_E_FAIL; if (str == NULL) { strcpy(buffer, "inet_ntop failed\n"); @@ -890,11 +891,13 @@ static int kvp_process_ip_address(void *addrp, } if (*offset == 0) strcpy(buffer, tmp); - else + else { + strcat(buffer, ";"); strcat(buffer, tmp); - strcat(buffer, ";"); + } *offset += strlen(str) + 1; + return 0; } @@ -956,7 +959,9 @@ kvp_get_ip_info(int family, char *if_name, int op, * supported address families; if not we gather info on * the specified address family. */ - if ((family != 0) && (curp->ifa_addr->sa_family != family)) { + if ((((family != 0) && + (curp->ifa_addr->sa_family != family))) || + (curp->ifa_flags & IFF_LOOPBACK)) { curp = curp->ifa_next; continue; }