Fix assertion when applying conversation color
Packet scoped memory cannot be used here; let's use the pinfo pool Change-Id: If76605f7a3021f5900fd46ce7d1c642a518c902f Reviewed-on: https://code.wireshark.org/review/6061 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
parent
ea6a5780c5
commit
a2beef95db
|
@ -170,8 +170,8 @@ static gchar*
|
|||
eth_build_color_filter(packet_info *pinfo)
|
||||
{
|
||||
return g_strdup_printf("eth.addr eq %s and eth.addr eq %s",
|
||||
address_to_str(wmem_packet_scope(), &pinfo->dl_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->dl_dst));
|
||||
address_to_str(pinfo->pool, &pinfo->dl_src),
|
||||
address_to_str(pinfo->pool, &pinfo->dl_dst));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -548,8 +548,8 @@ static gchar*
|
|||
ip_build_color_filter(packet_info *pinfo)
|
||||
{
|
||||
return g_strdup_printf("ip.addr eq %s and ip.addr eq %s",
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst));
|
||||
address_to_str(pinfo->pool, &pinfo->net_src),
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -643,8 +643,8 @@ tcp_build_color_filter(packet_info *pinfo)
|
|||
if( pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4 ) {
|
||||
/* TCP over IPv4 */
|
||||
return g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst),
|
||||
address_to_str(pinfo->pool, &pinfo->net_src),
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst),
|
||||
pinfo->srcport, pinfo->destport );
|
||||
}
|
||||
|
||||
|
|
|
@ -389,8 +389,8 @@ udp_build_color_filter(packet_info *pinfo)
|
|||
if( pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4 ) {
|
||||
/* UDP over IPv4 */
|
||||
return g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst),
|
||||
address_to_str(pinfo->pool, &pinfo->net_src),
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst),
|
||||
pinfo->srcport, pinfo->destport );
|
||||
}
|
||||
|
||||
|
|
|
@ -354,28 +354,28 @@ cba_build_color_filter(packet_info *pinfo)
|
|||
switch(GPOINTER_TO_UINT(profinet_type)) {
|
||||
case 1:
|
||||
return g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst));
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst),
|
||||
address_to_str(pinfo->pool, &pinfo->net_src),
|
||||
address_to_str(pinfo->pool, &pinfo->net_src),
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst));
|
||||
case 2:
|
||||
return g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src));
|
||||
address_to_str(pinfo->pool, &pinfo->net_src),
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst),
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst),
|
||||
address_to_str(pinfo->pool, &pinfo->net_src));
|
||||
case 3:
|
||||
return g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst));
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst),
|
||||
address_to_str(pinfo->pool, &pinfo->net_src),
|
||||
address_to_str(pinfo->pool, &pinfo->net_src),
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst));
|
||||
case 4:
|
||||
return g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_dst),
|
||||
address_to_str(wmem_packet_scope(), &pinfo->net_src));
|
||||
address_to_str(pinfo->pool, &pinfo->net_src),
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst),
|
||||
address_to_str(pinfo->pool, &pinfo->net_dst),
|
||||
address_to_str(pinfo->pool, &pinfo->net_src));
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue