From 64be8e73ff73bfb546d4753b58937d53898412cb Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 25 Jan 2016 03:38:31 +0100 Subject: [PATCH] lib:socket: set defaults for linkspeed and capability in get_interfaces() Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher --- lib/socket/interfaces.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c index 3b15615b8d1..e18fb07ffc1 100644 --- a/lib/socket/interfaces.c +++ b/lib/socket/interfaces.c @@ -24,6 +24,7 @@ #include "system/network.h" #include "interfaces.h" #include "lib/util/tsort.h" +#include "librpc/gen_ndr/ioctl.h" /**************************************************************************** Create a struct sockaddr_storage with the netmask bits set to 1. @@ -137,6 +138,7 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) int count; int total = 0; size_t copy_size; + uint64_t if_speed = 1000 * 1000 * 1000; /* 1GBit */ if (getifaddrs(&iflist) < 0) { return -1; @@ -220,6 +222,9 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) "%s\n", ifptr->ifa_name, strerror(errno)); } + ifaces[total].linkspeed = if_speed; + ifaces[total].capability = FSCTL_NET_IFACE_NONE_CAPABLE; + if (strlcpy(ifaces[total].name, ifptr->ifa_name, sizeof(ifaces[total].name)) >= sizeof(ifaces[total].name)) { -- 2.11.4.GIT