aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua_dumper.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/wslua/wslua_dumper.c')
-rw-r--r--epan/wslua/wslua_dumper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/wslua/wslua_dumper.c b/epan/wslua/wslua_dumper.c
index 747bb700f2..dba5e7cf7b 100644
--- a/epan/wslua/wslua_dumper.c
+++ b/epan/wslua/wslua_dumper.c
@@ -436,12 +436,14 @@ WSLUA_METHOD Dumper_dump_current(lua_State* L) {
pkthdr.ts.secs = lua_pinfo->fd->abs_ts.secs;
pkthdr.ts.nsecs = lua_pinfo->fd->abs_ts.nsecs;
pkthdr.len = tvb_reported_length(tvb);
- pkthdr.caplen = tvb_length(tvb);
+ pkthdr.caplen = tvb_captured_length(tvb);
pkthdr.pkt_encap = lua_pinfo->fd->lnk_t;
pkthdr.pseudo_header = *lua_pinfo->pseudo_header;
- if (lua_pinfo->pkt_comment)
- pkthdr.opt_comment = wmem_strdup(wmem_packet_scope(), lua_pinfo->pkt_comment);
+ if (lua_pinfo->fd->flags.has_user_comment)
+ pkthdr.opt_comment = wmem_strdup(wmem_packet_scope(), epan_get_user_comment(lua_pinfo->epan, lua_pinfo->fd));
+ else if (lua_pinfo->fd->flags.has_phdr_comment)
+ pkthdr.opt_comment = wmem_strdup(wmem_packet_scope(), lua_pinfo->phdr->opt_comment);
data = (const guchar *)tvb_memdup(wmem_packet_scope(),tvb,0,pkthdr.caplen);