diff options
author | Michael Adam <obnox@samba.org> | 2016-01-25 03:38:31 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2016-01-26 07:33:16 +0100 |
commit | 64be8e73ff73bfb546d4753b58937d53898412cb (patch) | |
tree | af94631593d61cde44bafc7b8d6e2e75c0154775 /lib/socket/interfaces.c | |
parent | 235f37baa7df03ef44f71aea50d72603297a611d (diff) | |
download | samba-64be8e73ff73bfb546d4753b58937d53898412cb.tar.gz |
lib:socket: set defaults for linkspeed and capability in get_interfaces()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/socket/interfaces.c')
-rw-r--r-- | lib/socket/interfaces.c | 5 |
1 files changed, 5 insertions, 0 deletions
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)) { |