Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336953
b: refs/heads/master
c: 3321e73
h: refs/heads/master
i:
  336951: 6235cfe
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Oct 30, 2012
1 parent 7d7f764 commit 00fc781
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f426a36cecfea2cfd69c28ca5ba4f4bfae913f63
refs/heads/master: 3321e738d6f0a82b2c19f9d5890f304dab1e5357
13 changes: 9 additions & 4 deletions trunk/tools/hv/hv_kvp_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <net/if.h>

/*
* KVP protocol: The user mode component first registers with the
Expand Down Expand Up @@ -882,19 +883,21 @@ 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");
return HV_E_FAIL;
}
if (*offset == 0)
strcpy(buffer, tmp);
else
else {
strcat(buffer, ";");
strcat(buffer, tmp);
strcat(buffer, ";");
}

*offset += strlen(str) + 1;

return 0;
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 00fc781

Please sign in to comment.