diff options
author | Peter Lemenkov <lemenkov@gmail.com> | 2014-05-14 16:03:09 +0400 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-05-20 22:01:43 +0000 |
commit | 572e76bdf09a48f5f09932f0718b4a82c30dfb5e (patch) | |
tree | f16261fd725616550a6e1dd2856abda5ea4e1749 /epan/dissectors/packet-rtpproxy.c | |
parent | 33fc6e614d438d20fbd0e734a793d7af23595c60 (diff) |
Don't panic in case of mediaproxy-ng/rtpengine extension
Change-Id: Id0441ec3e68b594051930623c17f45e806b79616
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Reviewed-on: https://code.wireshark.org/review/1633
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-rtpproxy.c')
-rw-r--r-- | epan/dissectors/packet-rtpproxy.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/epan/dissectors/packet-rtpproxy.c b/epan/dissectors/packet-rtpproxy.c index 5c6102e841..632cd1bb7b 100644 --- a/epan/dissectors/packet-rtpproxy.c +++ b/epan/dissectors/packet-rtpproxy.c @@ -801,7 +801,20 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data /* Extract IP */ memset(&addr, 0, sizeof(address)); - tmp = tvb_find_line_end(tvb, offset, -1, &new_offset, FALSE); + + /* Try rtpengine bogus extension first. It appends 4 or + * 6 depending on type of the IP. See + * https://github.com/sipwise/rtpengine/blob/master/daemon/call_interfaces.c#L66 + * for further details */ + tmp = tvb_find_guint8(tvb, offset, -1, ' '); + if(tmp == -1){ + /* No extension - operate normally */ + tmp = tvb_find_line_end(tvb, offset, -1, &new_offset, FALSE); + } + else { + tmp -= offset; + } + if (tvb_find_guint8(tvb, offset, -1, ':') == -1){ if (str_to_ip((char*)tvb_get_string(wmem_packet_scope(), tvb, offset, tmp), ipaddr)){ addr.type = AT_IPv4; |