The D-BUS protocol transfers only a single IPv6.

This commit is contained in:
Nikos Mavrogiannopoulos
2014-01-29 18:42:22 +01:00
parent a3889c9053
commit 1f08ebc70a
2 changed files with 5 additions and 32 deletions

View File

@@ -71,7 +71,7 @@ typedef struct {
#define ENTRY(name, iface, desc, func) \
{name, sizeof(name)-1, iface, sizeof(iface)-1, desc, sizeof(desc)-1, func}
#define LIST_USERS_SIG "(ussssssssusssss)"
#define LIST_USERS_SIG "(usssssssusssss)"
#define DESC_LIST \
" <method name=\"list\">\n" \
@@ -474,17 +474,6 @@ static int append_user_info(DBusMessageIter * subs, struct proc_st *ctmp)
return -1;
}
strtmp = NULL;
if (ctmp->ipv6 != NULL)
strtmp =
human_addr2((struct sockaddr *)&ctmp->ipv6->lip,
ctmp->ipv6->lip_len, ipbuf, sizeof(ipbuf), 0);
if (strtmp == NULL)
strtmp = "";
if (dbus_message_iter_append_basic
(subs, DBUS_TYPE_STRING, &strtmp) == 0) {
return -1;
}
tmp = ctmp->conn_time;
if (dbus_message_iter_append_basic(subs, DBUS_TYPE_UINT32, &tmp) == 0) {
return -1;

View File

@@ -541,7 +541,7 @@ int handle_list_users_cmd(DBusConnection * conn, const char *arg)
dbus_uint32_t since = 0;
char *groupname = "", *ip = "";
char *vpn_ipv4 = "", *vpn_ptp_ipv4 = "";
char *vpn_ipv6 = "", *vpn_ptp_ipv6 = "";
char *vpn_ipv6 = "";
char *hostname = "", *auth = "", *device = "";
char *user_agent = "";
char str_since[64];
@@ -623,13 +623,6 @@ int handle_list_users_cmd(DBusConnection * conn, const char *arg)
goto error_parse;
dbus_message_iter_get_basic(&subs, &vpn_ipv4);
if (!dbus_message_iter_next(&subs))
goto error_recv;
if (dbus_message_iter_get_arg_type(&subs) != DBUS_TYPE_STRING)
goto error_parse;
dbus_message_iter_get_basic(&subs, &vpn_ptp_ipv6);
if (!dbus_message_iter_next(&subs))
goto error_recv;
@@ -742,7 +735,7 @@ int common_info_cmd(DBusMessageIter * args)
dbus_uint32_t since = 0;
char *groupname = "", *ip = "";
char *vpn_ipv4 = "", *vpn_ptp_ipv4 = "";
char *vpn_ipv6 = "", *vpn_ptp_ipv6 = "";
char *vpn_ipv6 = "";
char *hostname = "", *auth = "", *device = "";
char *user_agent = "";
char str_since[64];
@@ -817,13 +810,6 @@ int common_info_cmd(DBusMessageIter * args)
goto error_parse;
dbus_message_iter_get_basic(&subs, &vpn_ipv4);
if (!dbus_message_iter_next(&subs))
goto error_recv;
if (dbus_message_iter_get_arg_type(&subs) != DBUS_TYPE_STRING)
goto error_parse;
dbus_message_iter_get_basic(&subs, &vpn_ptp_ipv6);
if (!dbus_message_iter_next(&subs))
goto error_recv;
@@ -894,10 +880,8 @@ int common_info_cmd(DBusMessageIter * args)
fprintf(out, "\tIPv4: %s ", vpn_ipv4);
fprintf(out, "P-t-P IPv4: %s\n", vpn_ptp_ipv4);
}
if (vpn_ipv6 != NULL && vpn_ipv6[0] != 0 &&
vpn_ptp_ipv6 != NULL && vpn_ptp_ipv6[0] != 0) {
fprintf(out, "\tIPv6: %s ", vpn_ipv6);
fprintf(out, "P-t-P IPv6: %s\n", vpn_ptp_ipv6);
if (vpn_ipv6 != NULL && vpn_ipv6[0] != 0) {
fprintf(out, "\tIPv6: %s\n", vpn_ipv6);
}
fprintf(out, "\tDevice: %s ", device);