client->common.ip = data->source_ip;
if (data->source_port != 0)
client->common.remote_port = data->source_port;
+ if (data->dest_ip.family != 0)
+ client->common.local_ip = data->dest_ip;
+ if (data->dest_port != 0)
+ client->common.local_port = data->dest_port;
if (data->ttl_plus_1 > 0)
client->common.proxy_ttl = data->ttl_plus_1 - 1;
if (data->session != NULL) {
addr = t_strconcat("IPV6:", addr, NULL);
proxy_send_xclient_more(client, output, str, "ADDR", addr);
}
+ if (str_array_icase_find(client->proxy_xclient, "DESTPORT")) {
+ proxy_send_xclient_more(
+ client, output, str, "DESTPORT",
+ t_strdup_printf("%u", client->common.local_port));
+ }
+ if (str_array_icase_find(client->proxy_xclient, "DESTADDR")) {
+ const char *addr = net_ip2addr(&client->common.local_ip);
+ if (client->common.local_ip.family == AF_INET6)
+ addr = t_strconcat("IPV6:", addr, NULL);
+ proxy_send_xclient_more(client, output, str, "DESTADDR", addr);
+ }
if (str_array_icase_find(client->proxy_xclient, "SESSION")) {
proxy_send_xclient_more(client, output, str, "SESSION",
client_get_session_id(&client->common));