1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

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>
This commit is contained in:
Michael Adam 2016-01-25 03:38:31 +01:00
parent 235f37baa7
commit 64be8e73ff

View File

@ -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)) {