dest.sin4.sin_family = 0;
}
- if (dest.sin4.sin_family == 0) {
- dest = cs.local;
- }
-
++cs.queries;
++g_stats.queries;
return;
}
/* dest might have been updated, if we managed to harvest the destination address */
- ids.origDest = dest;
- ids.hopLocal = dest;
+ if (dest.sin4.sin_family != 0) {
+ ids.origDest = dest;
+ ids.hopLocal = dest;
+ }
+ else {
+ /* if we have not been able to harvest the destination address,
+ we do NOT want to update dest or hopLocal, to let the kernel
+ pick the less terrible option, but we want to update origDest
+ which is used by rules and actions to at least the correct
+ address family */
+ ids.origDest = cs.local;
+ }
std::vector<ProxyProtocolValue> proxyProtocolValues;
if (expectProxyProtocol && !handleProxyProtocol(remote, false, *holders.acl, query, ids.origRemote, ids.origDest, proxyProtocolValues)) {