Skip to content

[netstack2]: Relaying packet even though lookup fails? #206

@LaurenceJJones

Description

@LaurenceJJones

newt/netstack2/proxy.go

Lines 463 to 471 in d5e0771

if err != nil {
// Failed to resolve, skip DNAT but still proxy the packet
logger.Debug("Failed to resolve rewrite address: %v", err)
pkb := stack.NewPacketBuffer(stack.PacketBufferOptions{
Payload: buffer.MakeWithData(packet),
})
p.proxyEp.InjectInbound(header.IPv4ProtocolNumber, pkb)
return true
}

Hey the above code attempt to resolve the rewrite address either using the ip/cidr notation or by performing a DNS lookup. If parsing fails or dns fails we still relay the packet to the VIP?

Im looking at adding an internal DNS cache since every new connection will perform a dns lookup which adds latency to every request (until a net state is created) which we can perform the lookup for a user, then cache for a TTL.

However, it seems that forwarding even if resolution fails is not correct behavior, asking in case it was intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions