debugs(33, 5, "PROXY/1.0 protocol on connection " << clientConnection);
clientConnection->local = originalDest;
clientConnection->remote = originalClient;
- clientConnection->flags ^= COMM_TRANSPARENT; // prevent TPROXY spoofing of this new IP.
+ if ((clientConnection->flags & COMM_TRANSPARENT))
+ clientConnection->flags ^= COMM_TRANSPARENT; // prevent TPROXY spoofing of this new IP.
debugs(33, 5, "PROXY/1.0 upgrade: " << clientConnection);
// repeat fetch ensuring the new client FQDN can be logged
clientConnection->local.port(ntohs(ipu.ipv4_addr.dst_port));
clientConnection->remote = ipu.ipv4_addr.src_addr;
clientConnection->remote.port(ntohs(ipu.ipv4_addr.src_port));
- clientConnection->flags ^= COMM_TRANSPARENT; // prevent TPROXY spoofing of this new IP.
+ if ((clientConnection->flags & COMM_TRANSPARENT))
+ clientConnection->flags ^= COMM_TRANSPARENT; // prevent TPROXY spoofing of this new IP.
break;
case 0x2: // IPv6
clientConnection->local = ipu.ipv6_addr.dst_addr;
clientConnection->local.port(ntohs(ipu.ipv6_addr.dst_port));
clientConnection->remote = ipu.ipv6_addr.src_addr;
clientConnection->remote.port(ntohs(ipu.ipv6_addr.src_port));
- clientConnection->flags ^= COMM_TRANSPARENT; // prevent TPROXY spoofing of this new IP.
+ if ((clientConnection->flags & COMM_TRANSPARENT))
+ clientConnection->flags ^= COMM_TRANSPARENT; // prevent TPROXY spoofing of this new IP.
break;
default: // do nothing
break;