UpdateFromNodeAttributes updates k (if non-nil) based on the provided self node attributes (Node.Capabilities).
(capMap tailcfg.NodeCapMap)
| 140 | // UpdateFromNodeAttributes updates k (if non-nil) based on the provided self |
| 141 | // node attributes (Node.Capabilities). |
| 142 | func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) { |
| 143 | if k == nil { |
| 144 | return |
| 145 | } |
| 146 | has := capMap.Contains |
| 147 | var ( |
| 148 | disableUPnP = has(tailcfg.NodeAttrDisableUPnP) |
| 149 | randomizeClientPort = has(tailcfg.NodeAttrRandomizeClientPort) |
| 150 | disableDeltaUpdates = has(tailcfg.NodeAttrDisableDeltaUpdates) |
| 151 | oneCGNAT opt.Bool |
| 152 | forceBackgroundSTUN = has(tailcfg.NodeAttrDebugForceBackgroundSTUN) |
| 153 | peerMTUEnable = has(tailcfg.NodeAttrPeerMTUEnable) |
| 154 | dnsForwarderDisableTCPRetries = has(tailcfg.NodeAttrDNSForwarderDisableTCPRetries) |
| 155 | silentDisco = has(tailcfg.NodeAttrSilentDisco) |
| 156 | forceIPTables = has(tailcfg.NodeAttrLinuxMustUseIPTables) |
| 157 | forceNfTables = has(tailcfg.NodeAttrLinuxMustUseNfTables) |
| 158 | probeUDPLifetime = has(tailcfg.NodeAttrProbeUDPLifetime) |
| 159 | appCStoreRoutes = has(tailcfg.NodeAttrStoreAppCRoutes) |
| 160 | userDialUseRoutes = has(tailcfg.NodeAttrUserDialUseRoutes) |
| 161 | disableSplitDNSWhenNoCustomResolvers = has(tailcfg.NodeAttrDisableSplitDNSWhenNoCustomResolvers) |
| 162 | disableLocalDNSOverrideViaNRPT = has(tailcfg.NodeAttrDisableLocalDNSOverrideViaNRPT) |
| 163 | disableCaptivePortalDetection = has(tailcfg.NodeAttrDisableCaptivePortalDetection) |
| 164 | disableSkipStatusQueue = has(tailcfg.NodeAttrDisableSkipStatusQueue) |
| 165 | disableHostsFileUpdates = has(tailcfg.NodeAttrDisableHostsFileUpdates) |
| 166 | forceRegisterMagicDNSIPv4Only = has(tailcfg.NodeAttrForceRegisterMagicDNSIPv4Only) |
| 167 | emitRuntimeMetrics = has(tailcfg.NodeAttrEmitRuntimeMetrics) |
| 168 | disableUDPGRO = has(tailcfg.NodeAttrDisableUDPGRO) |
| 169 | disableUDPGSO = has(tailcfg.NodeAttrDisableUDPGSO) |
| 170 | disableTUNUDPGRO = has(tailcfg.NodeAttrDisableTUNUDPGRO) |
| 171 | disableTUNTCPGRO = has(tailcfg.NodeAttrDisableTUNTCPGRO) |
| 172 | neverGSOEqualTail = has(tailcfg.NodeAttrNeverGSOEqualTail) |
| 173 | ) |
| 174 | |
| 175 | if has(tailcfg.NodeAttrOneCGNATEnable) { |
| 176 | oneCGNAT.Set(true) |
| 177 | } else if has(tailcfg.NodeAttrOneCGNATDisable) { |
| 178 | oneCGNAT.Set(false) |
| 179 | } |
| 180 | |
| 181 | k.DisableUPnP.Store(disableUPnP) |
| 182 | k.RandomizeClientPort.Store(randomizeClientPort) |
| 183 | k.OneCGNAT.Store(oneCGNAT) |
| 184 | k.ForceBackgroundSTUN.Store(forceBackgroundSTUN) |
| 185 | k.DisableDeltaUpdates.Store(disableDeltaUpdates) |
| 186 | k.PeerMTUEnable.Store(peerMTUEnable) |
| 187 | k.DisableDNSForwarderTCPRetries.Store(dnsForwarderDisableTCPRetries) |
| 188 | k.SilentDisco.Store(silentDisco) |
| 189 | k.LinuxForceIPTables.Store(forceIPTables) |
| 190 | k.LinuxForceNfTables.Store(forceNfTables) |
| 191 | k.ProbeUDPLifetime.Store(probeUDPLifetime) |
| 192 | k.AppCStoreRoutes.Store(appCStoreRoutes) |
| 193 | k.UserDialUseRoutes.Store(userDialUseRoutes) |
| 194 | k.DisableSplitDNSWhenNoCustomResolvers.Store(disableSplitDNSWhenNoCustomResolvers) |
| 195 | k.DisableLocalDNSOverrideViaNRPT.Store(disableLocalDNSOverrideViaNRPT) |
| 196 | k.DisableCaptivePortalDetection.Store(disableCaptivePortalDetection) |
| 197 | k.DisableSkipStatusQueue.Store(disableSkipStatusQueue) |
| 198 | k.DisableHostsFileUpdates.Store(disableHostsFileUpdates) |
| 199 | k.ForceRegisterMagicDNSIPv4Only.Store(forceRegisterMagicDNSIPv4Only) |
no test coverage detected