str_printfa(str, "\ttag=%s", client->state.tag);
if (state->local_ip.family != 0)
str_printfa(str, "\tlip=%s", net_ip2addr(&state->local_ip));
+ if (state->local_port != 0)
+ str_printfa(str, "\tlport=%u", state->local_port);
if (state->remote_ip.family != 0)
str_printfa(str, "\trip=%s", net_ip2addr(&state->remote_ip));
+ if (state->remote_port != 0)
+ str_printfa(str, "\trport=%u", state->remote_port);
if (state->userdb_fields != NULL) {
str_append(str, "\tuserdb_fields=");
str_append_tabescaped(str, state->userdb_fields);
/* optional: */
const char *session_id, *userdb_fields, *stats;
struct ip_addr local_ip, remote_ip;
+ in_port_t local_port, remote_port;
time_t session_created;
uid_t uid;
"Invalid lip value: %s", value);
return -1;
}
+ } else if (strcmp(key, "lport") == 0) {
+ if (net_str2port(value, &state_r->local_port) < 0) {
+ *error_r = t_strdup_printf(
+ "Invalid lport value: %s", value);
+ return -1;
+ }
} else if (strcmp(key, "rip") == 0) {
if (net_addr2ip(value, &state_r->remote_ip) < 0) {
*error_r = t_strdup_printf(
"Invalid rip value: %s", value);
return -1;
}
+ } else if (strcmp(key, "rport") == 0) {
+ if (net_str2port(value, &state_r->remote_port) < 0) {
+ *error_r = t_strdup_printf(
+ "Invalid rport value: %s", value);
+ return -1;
+ }
} else if (strcmp(key, "peer_dev_major") == 0) {
if (str_to_uint(value, &peer_dev_major) < 0) {
*error_r = t_strdup_printf(
}
if (user->conn.local_ip != NULL)
str_printfa(cmd, "\tlip=%s", net_ip2addr(user->conn.local_ip));
+ if (user->conn.local_port != 0)
+ str_printfa(cmd, "\tlport=%u", user->conn.local_port);
if (user->conn.remote_ip != NULL)
str_printfa(cmd, "\trip=%s", net_ip2addr(user->conn.remote_ip));
+ if (user->conn.remote_port != 0)
+ str_printfa(cmd, "\trport=%u", user->conn.remote_port);
if (client->userdb_fields != NULL) {
string_t *userdb_fields = t_str_new(256);
unsigned int i;
"Invalid lip value: %s", value);
return -1;
}
+ } else if (strcmp(key, "lport") == 0) {
+ if (net_str2port(value, &input_r->local_port) < 0) {
+ *error_r = t_strdup_printf(
+ "Invalid lport value: %s", value);
+ return -1;
+ }
} else if (strcmp(key, "rip") == 0) {
if (net_addr2ip(value, &input_r->remote_ip) < 0) {
*error_r = t_strdup_printf(
"Invalid rip value: %s", value);
return -1;
}
+ } else if (strcmp(key, "rport") == 0) {
+ if (net_str2port(value, &input_r->remote_port) < 0) {
+ *error_r = t_strdup_printf(
+ "Invalid rport value: %s", value);
+ return -1;
+ }
} else if (strcmp(key, "peer_dev_major") == 0) {
if (str_to_uint(value, &peer_dev_major) < 0) {
*error_r = t_strdup_printf(