MCPcopy Create free account
hub / github.com/pion/ice / warnOnAddressRewriteConflicts

Function warnOnAddressRewriteConflicts

agent_options.go:61–86  ·  view source on GitHub ↗
(agent *Agent)

Source from the content-addressed store, hash-verified

59}
60
61func warnOnAddressRewriteConflicts(agent *Agent) {
62 if agent == nil || agent.log == nil {
63 return
64 }
65
66 for _, conflict := range findAddressRewriteRuleConflicts(agent.addressRewriteRules) {
67 scope := conflict.scope
68 scopeSummary := fmt.Sprintf(
69 "candidate=%s iface=%s cidr=%s networks=%s local=%s",
70 scope.candidateType.String(),
71 emptyScopeValue(scope.iface),
72 emptyScopeValue(scope.cidr),
73 emptyScopeValue(scope.networksKey),
74 scope.localKey,
75 )
76
77 message := fmt.Sprintf(
78 "detected overlapping address rewrite rule (%s): existing external IPs [%s], additional external IP %s",
79 scopeSummary,
80 strings.Join(conflict.existingExternalIPs, ", "),
81 conflict.conflictingExternal,
82 )
83
84 agent.log.Warn(message)
85 }
86}
87
88func emptyScopeValue(v string) string {
89 if v == "" {

Callers 1

Calls 4

emptyScopeValueFunction · 0.85
StringMethod · 0.65
WarnMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…