From 22568599e879503c3f554d34c38cb6ecf48411e9 Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Thu, 2 May 2019 17:14:35 -0400 Subject: [PATCH] client fingerprinting can keep multi ips on a device --- client/client.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/client/client.go b/client/client.go index c8bed1e95..8492882d9 100644 --- a/client/client.go +++ b/client/client.go @@ -1291,15 +1291,21 @@ func updateNetworks(ns structs.Networks, up structs.Networks, c *config.Config) if c.NetworkInterface == "" { ns = up } else { - // if a network is configured, use only that network - // use the fingerprinted data + // If a network device is configured, filter up to contain details for only + // that device + upd := []*structs.NetworkResource{} for _, n := range up { if c.NetworkInterface == n.Device { - ns = []*structs.NetworkResource{n} + upd = append(upd, n) } } - // if not matched, ns has the old data + if len(upd) > 0 { + ns = upd + } + // Otherwise, ns has the old data } + + // ns is set, apply the config NetworkSpeed to all if c.NetworkSpeed != 0 { for _, n := range ns { n.MBits = c.NetworkSpeed