diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2008-04-12 23:45:25 +0000 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2008-04-12 23:45:25 +0000 |
commit | dae4e65b6d2d0dba79735f49efe15bb013fc5f48 (patch) | |
tree | 40064b0f17e5d75a7b8ac42e1bb0722eb82bb752 /epan/dissectors/packet-dplay.c | |
parent | 1f8e6c08bec07688f19da62e4d0f3a5996ebd9fb (diff) |
Fix for bug 2452:
Tighten heuristics on DirectPlay player to player messages, so that RTP isn't mistaken as such.
svn path=/trunk/; revision=24965
Diffstat (limited to 'epan/dissectors/packet-dplay.c')
-rw-r--r-- | epan/dissectors/packet-dplay.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dplay.c b/epan/dissectors/packet-dplay.c index 6471b769b6..6151f05017 100644 --- a/epan/dissectors/packet-dplay.c +++ b/epan/dissectors/packet-dplay.c @@ -29,6 +29,14 @@ # include "config.h" #endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> /* needed to define AF_ values on Windows */ +#endif + #include <epan/packet.h> #include <epan/prefs.h> #include <epan/emem.h> @@ -356,7 +364,7 @@ static const value_string dplay_command_val[] = { static const value_string dplay_af_val[] = { { 0x0002, "AF_INET" }, - { 0x0006, "AF_IPX" }, + { 0x0006, "AF_IPX" }, /* XXX - sys/socket.h: AF_IPX is 4 ? */ { 0 , NULL}, }; @@ -1197,8 +1205,16 @@ static gboolean heur_dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree token = tvb_get_letohl(tvb, 0); token = (token & 0xfff00000) >> 20; if (token == 0xfab || token == 0xbab || token == 0xcab) { + /* Check the s_addr_in structure */ + if (tvb_get_letohs(tvb, 4) == AF_INET) { + int offset; + for (offset = 12; offset <= 20; offset++) + if (tvb_get_guint8(tvb, offset) != 0) + return FALSE; + dissect_dplay_player_msg(tvb, pinfo, tree); return TRUE; + } } return FALSE; |