Skip to content

Commit

Permalink
fqdn: Fix Restore Check Logic
Browse files Browse the repository at this point in the history
[ upstream commit 79029db ]

Sometimes restored IPRules do not have the
default "nil" populating their IP maps, but instead have
an empty map structure. We need to check for this
restore possibility.

Signed-off-by: Nate Sweet <nathanjsweet@pm.me>
  • Loading branch information
nathanjsweet authored and lmb committed Apr 10, 2024
1 parent 848f4f1 commit 5b642b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/fqdn/dnsproxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (p *DNSProxy) checkRestored(endpointID uint64, destPortProto restore.PortPr

for i := range ipRules {
ipRule := ipRules[i]
if _, exists := ipRule.IPs[destIP]; exists || ipRule.IPs == nil {
if _, exists := ipRule.IPs[destIP]; exists || len(ipRule.IPs) == 0 {
if ipRule.regex != nil && ipRule.regex.MatchString(name) {
return true
}
Expand Down

0 comments on commit 5b642b6

Please sign in to comment.