QUIC: fix compilation on Raspberry

This commit is contained in:
Nardi Ivan 2021-10-17 18:06:59 +02:00 committed by Wireshark GitLab Utility
parent a1031afbff
commit 763247c2b3
5 changed files with 27 additions and 23 deletions

View File

@ -116,6 +116,7 @@ libwsutil.so.0 libwsutil0 #MINVER#
init_progfile_dir@Base 1.12.0~rc1 init_progfile_dir@Base 1.12.0~rc1
init_report_message@Base 2.3.0 init_report_message@Base 2.3.0
int64_to_str_back@Base 3.5.1 int64_to_str_back@Base 3.5.1
int_compare@Base 3.6.0
int_to_str_back@Base 3.5.1 int_to_str_back@Base 3.5.1
ip6_to_str@Base 3.5.1 ip6_to_str@Base 3.5.1
ip6_to_str_buf@Base 3.5.1 ip6_to_str_buf@Base 3.5.1
@ -218,7 +219,7 @@ libwsutil.so.0 libwsutil0 #MINVER#
tm_is_valid@Base 3.5.0 tm_is_valid@Base 3.5.0
type_util_gdouble_to_guint64@Base 1.10.0 type_util_gdouble_to_guint64@Base 1.10.0
type_util_guint64_to_gdouble@Base 1.10.0 type_util_guint64_to_gdouble@Base 1.10.0
uint64_compare@Base 3.5.0 uint_compare@Base 3.6.0
uint64_to_str_back@Base 3.5.1 uint64_to_str_back@Base 3.5.1
uint64_to_str_back_len@Base 3.5.1 uint64_to_str_back_len@Base 3.5.1
uint_to_str_back@Base 3.5.1 uint_to_str_back@Base 3.5.1

View File

@ -3811,9 +3811,9 @@ quic_streams_add(packet_info *pinfo, quic_info_data_t *quic_info, guint64 stream
if (!quic_info->streams_list) { if (!quic_info->streams_list) {
quic_info->streams_list = wmem_list_new(wmem_file_scope()); quic_info->streams_list = wmem_list_new(wmem_file_scope());
} }
if (!wmem_list_find(quic_info->streams_list, (void *)(stream_id))) { if (!wmem_list_find(quic_info->streams_list, GUINT_TO_POINTER(stream_id))) {
wmem_list_insert_sorted(quic_info->streams_list, (void *)(stream_id), wmem_list_insert_sorted(quic_info->streams_list, GUINT_TO_POINTER(stream_id),
uint64_compare); uint_compare);
} }
/* Map: first Stream ID for each UDP payload */ /* Map: first Stream ID for each UDP payload */
@ -3852,7 +3852,7 @@ quic_get_stream_id_le(guint streamid, guint sub_stream_id, guint *sub_stream_id_
{ {
quic_info_data_t *quic_info; quic_info_data_t *quic_info;
wmem_list_frame_t *curr_entry; wmem_list_frame_t *curr_entry;
guint64 prev_stream_id; guint prev_stream_id;
quic_info = get_conn_by_number(streamid); quic_info = get_conn_by_number(streamid);
if (!quic_info) { if (!quic_info) {
@ -3862,20 +3862,20 @@ quic_get_stream_id_le(guint streamid, guint sub_stream_id, guint *sub_stream_id_
return FALSE; return FALSE;
} }
prev_stream_id = G_MAXUINT64; prev_stream_id = G_MAXUINT32;
curr_entry = wmem_list_head(quic_info->streams_list); curr_entry = wmem_list_head(quic_info->streams_list);
while (curr_entry) { while (curr_entry) {
if ((guint64)wmem_list_frame_data(curr_entry) > sub_stream_id && if (GPOINTER_TO_UINT(wmem_list_frame_data(curr_entry)) > sub_stream_id &&
prev_stream_id != G_MAXUINT64) { prev_stream_id != G_MAXUINT32) {
*sub_stream_id_out = (guint)prev_stream_id; *sub_stream_id_out = (guint)prev_stream_id;
return TRUE; return TRUE;
} }
prev_stream_id = (guint64)wmem_list_frame_data(curr_entry); prev_stream_id = GPOINTER_TO_UINT(wmem_list_frame_data(curr_entry));
curr_entry = wmem_list_frame_next(curr_entry); curr_entry = wmem_list_frame_next(curr_entry);
} }
if (prev_stream_id != G_MAXUINT64) { if (prev_stream_id != G_MAXUINT32) {
*sub_stream_id_out = (guint)prev_stream_id; *sub_stream_id_out = prev_stream_id;
return TRUE; return TRUE;
} }
@ -3898,9 +3898,9 @@ quic_get_stream_id_ge(guint streamid, guint sub_stream_id, guint *sub_stream_id_
curr_entry = wmem_list_head(quic_info->streams_list); curr_entry = wmem_list_head(quic_info->streams_list);
while (curr_entry) { while (curr_entry) {
if ((guint64)wmem_list_frame_data(curr_entry) >= sub_stream_id) { if (GPOINTER_TO_UINT(wmem_list_frame_data(curr_entry)) >= sub_stream_id) {
/* StreamIDs are 64 bits long in QUIC, but "Follow Stream" generic code uses guint variables */ /* StreamIDs are 64 bits long in QUIC, but "Follow Stream" generic code uses guint variables */
*sub_stream_id_out = (guint)(guint64)wmem_list_frame_data(curr_entry); *sub_stream_id_out = GPOINTER_TO_UINT(wmem_list_frame_data(curr_entry));
return TRUE; return TRUE;
} }
curr_entry = wmem_list_frame_next(curr_entry); curr_entry = wmem_list_frame_next(curr_entry);

View File

@ -30,9 +30,15 @@ wmem_memdup(wmem_allocator_t *allocator, const void *source, const size_t size)
} }
gint gint
uint64_compare(gconstpointer a, gconstpointer b) int_compare(gconstpointer a, gconstpointer b)
{ {
return (guint64)(a) > (guint64)(b) ? 1 : ((guint64)(a) < (guint64)(b) ? -1 : 0); return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b);
}
gint
uint_compare(gconstpointer a, gconstpointer b)
{
return GPOINTER_TO_UINT(a) > GPOINTER_TO_UINT(b) ? 1 : (GPOINTER_TO_UINT(a) < GPOINTER_TO_UINT(b) ? -1 : 0);
} }
/* /*

View File

@ -40,12 +40,15 @@ void *
wmem_memdup(wmem_allocator_t *allocator, const void *source, const size_t size) wmem_memdup(wmem_allocator_t *allocator, const void *source, const size_t size)
G_GNUC_MALLOC; G_GNUC_MALLOC;
/** Generic GCompareFunc implementation to compare unsigned integer 64 bits long /** Generic GCompareFunc implementations to compare signed/unsigned integer
*/ */
WS_DLL_PUBLIC WS_DLL_PUBLIC
gint gint
uint64_compare(gconstpointer a, gconstpointer b); int_compare(gconstpointer a, gconstpointer b);
WS_DLL_PUBLIC
gint
uint_compare(gconstpointer a, gconstpointer b);
/** @} /** @}
* @} */ * @} */

View File

@ -738,12 +738,6 @@ check_val_list(gpointer val, gpointer val_to_check)
g_assert_true(val == val_to_check); g_assert_true(val == val_to_check);
} }
static gint
int_compare(gconstpointer a, gconstpointer b)
{
return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b);
}
static gint static gint
str_compare(gconstpointer a, gconstpointer b) str_compare(gconstpointer a, gconstpointer b)
{ {