diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-12-04 06:05:49 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-12-04 06:05:49 +0000 |
commit | 35bf0b2abc3c00a68752f3982f950184147160e4 (patch) | |
tree | c8da46cadf191c6e4f479556c96242e8df8e0afd /packet-ldp.c | |
parent | e152085fa84c6bce9a4520c961c220fa82c1b4d5 (diff) |
Don't loop infinitely if we see a Host Address or unknown Forwarding
Equivalence Class.
Set "pinfo->current_proto", so that if we run past the end of the data
the problem is noted as being with LDP.
svn path=/trunk/; revision=2743
Diffstat (limited to 'packet-ldp.c')
-rw-r--r-- | packet-ldp.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/packet-ldp.c b/packet-ldp.c index 2966e886e5..70a4add32d 100644 --- a/packet-ldp.c +++ b/packet-ldp.c @@ -1,7 +1,7 @@ /* packet-ldp.c * Routines for ldp packet disassembly * - * $Id: packet-ldp.c,v 1.8 2000/12/03 02:37:56 sharpe Exp $ + * $Id: packet-ldp.c,v 1.9 2000/12/04 06:05:49 guy Exp $ * * Copyright (c) November 2000 by Richard Sharpe <rsharpe@ns.aus.com> * @@ -295,6 +295,8 @@ int dissect_tlv(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) offset += 1; + /* XXX - the address family length should be extracted and used to + dissect the prefix field. */ proto_tree_add_item(fec_tree, hf_ldp_tlv_fec_af, tvb, offset, 2, FALSE); offset += 2; @@ -311,10 +313,21 @@ int dissect_tlv(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) case 3: /* Host address */ + /* XXX - write me. */ + + fec_len -= 8; + + offset += 8; + break; default: /* Unknown */ + /* XXX - do all FEC's have a length that's a multiple of 4? */ + + fec_len -= 4; + + offset += 4; break; @@ -518,6 +531,8 @@ dissect_ldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) CHECK_DISPLAY_AS_DATA(proto_ldp, tvb, pinfo, tree); + pinfo->current_proto = "LDP"; + if (check_col(pinfo->fd, COL_PROTOCOL)) col_add_str(pinfo->fd, COL_PROTOCOL, "LDP"); |