diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/hv/hv_kvp_daemon.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c index 13ae098a0114..de1724cbaf59 100644 --- a/tools/hv/hv_kvp_daemon.c +++ b/tools/hv/hv_kvp_daemon.c | |||
@@ -534,6 +534,7 @@ kvp_get_ip_address(int family, char *if_name, int op, | |||
534 | struct ifaddrs *ifap; | 534 | struct ifaddrs *ifap; |
535 | struct ifaddrs *curp; | 535 | struct ifaddrs *curp; |
536 | int offset = 0; | 536 | int offset = 0; |
537 | int sn_offset = 0; | ||
537 | const char *str; | 538 | const char *str; |
538 | int error = 0; | 539 | int error = 0; |
539 | char *buffer; | 540 | char *buffer; |
@@ -594,12 +595,38 @@ kvp_get_ip_address(int family, char *if_name, int op, | |||
594 | * Gather info other than the IP address. | 595 | * Gather info other than the IP address. |
595 | * IP address info will be gathered later. | 596 | * IP address info will be gathered later. |
596 | */ | 597 | */ |
597 | if (curp->ifa_addr->sa_family == AF_INET) | 598 | if (curp->ifa_addr->sa_family == AF_INET) { |
598 | ip_buffer->addr_family |= ADDR_FAMILY_IPV4; | 599 | ip_buffer->addr_family |= ADDR_FAMILY_IPV4; |
599 | else | 600 | /* |
601 | * Get subnet info. | ||
602 | */ | ||
603 | error = kvp_process_ip_address( | ||
604 | curp->ifa_netmask, | ||
605 | AF_INET, | ||
606 | (char *) | ||
607 | ip_buffer->sub_net, | ||
608 | length, | ||
609 | &sn_offset); | ||
610 | if (error) | ||
611 | goto gather_ipaddr; | ||
612 | } else { | ||
600 | ip_buffer->addr_family |= ADDR_FAMILY_IPV6; | 613 | ip_buffer->addr_family |= ADDR_FAMILY_IPV6; |
614 | /* | ||
615 | * Get subnet info. | ||
616 | */ | ||
617 | error = kvp_process_ip_address( | ||
618 | curp->ifa_netmask, | ||
619 | AF_INET6, | ||
620 | (char *) | ||
621 | ip_buffer->sub_net, | ||
622 | length, | ||
623 | &sn_offset); | ||
624 | if (error) | ||
625 | goto gather_ipaddr; | ||
626 | } | ||
601 | } | 627 | } |
602 | 628 | ||
629 | gather_ipaddr: | ||
603 | error = kvp_process_ip_address(curp->ifa_addr, | 630 | error = kvp_process_ip_address(curp->ifa_addr, |
604 | curp->ifa_addr->sa_family, | 631 | curp->ifa_addr->sa_family, |
605 | buffer, | 632 | buffer, |