diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2008-04-10 19:35:07 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2008-04-10 19:35:07 +0000 |
commit | d4b67e68f432065c85717155361268ed402993e2 (patch) | |
tree | 243dd10519d41a35ff8390a679d63f324fbb2f6f /epan/dissectors/packet-redbackli.c | |
parent | 188543e98d21336c4cf689170867a3798267cf72 (diff) |
From Florian Lohoff: fix http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2376 (and hopefully the other complaints about RedbackLI grabbing packets that aren't RedbackLI) by strengthening the heuristics.
svn path=/trunk/; revision=24878
Diffstat (limited to 'epan/dissectors/packet-redbackli.c')
-rw-r--r-- | epan/dissectors/packet-redbackli.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/epan/dissectors/packet-redbackli.c b/epan/dissectors/packet-redbackli.c index d62b28eed2..3f50d94e9f 100644 --- a/epan/dissectors/packet-redbackli.c +++ b/epan/dissectors/packet-redbackli.c @@ -176,6 +176,7 @@ redbackli_dissect_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { gint len, offset=0, eoh=0; guint8 avptype, avplen; + guint32 avpfound=0; len=tvb_length(tvb); if (len < MIN_REDBACKLI_SIZE) @@ -197,11 +198,13 @@ redbackli_dissect_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case(RB_AVP_SESSID): if (avplen != 4) return FALSE; + avpfound|=1<<avptype; break; case(RB_AVP_LABEL): + avpfound|=1<<avptype; break; case(RB_AVP_EOH): - if (avplen > 1) + if (avplen > 1 || offset == 0) return FALSE; eoh=1; break; @@ -212,6 +215,13 @@ redbackli_dissect_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) len-=2+avplen; } + if (!(avpfound & (1<<RB_AVP_SEQNO))) + return FALSE; + if (!(avpfound & (1<<RB_AVP_SESSID))) + return FALSE; + if (!(avpfound & (1<<RB_AVP_LIID))) + return FALSE; + redbackli_dissect(tvb, pinfo, tree); return TRUE; |