Merge pull request #2406 from syncthing/fix-non-local-local-networks

Consider 'AlwaysLocalNets' in bandwidth limiters
This commit is contained in:
Audrius Butkevicius 2015-10-24 13:07:04 +01:00
commit e725c97967

View File

@ -600,17 +600,18 @@ func syncthingMain() {
if (opts.MaxRecvKbps > 0 || opts.MaxSendKbps > 0) && !opts.LimitBandwidthInLan {
lans, _ = osutil.GetLans()
networks := make([]string, 0, len(lans))
for _, lan := range lans {
networks = append(networks, lan.String())
}
for _, lan := range opts.AlwaysLocalNets {
_, ipnet, err := net.ParseCIDR(lan)
if err != nil {
l.Infoln("Network", lan, "is malformed:", err)
continue
}
networks = append(networks, ipnet.String())
lans = append(lans, ipnet)
}
networks := make([]string, len(lans))
for i, lan := range lans {
networks[i] = lan.String()
}
l.Infoln("Local networks:", strings.Join(networks, ", "))
}