From a2d0f1fa4919af9bf2737669c2b9854428160265 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 4 Aug 2002 08:44:31 +0000 Subject: [PATCH] From Hidetaka Ogawa: fix PPP FCS computation to include address and control field if present. Add Sergei Shokhor to the contributor list in the Ethereal man page. svn path=/trunk/; revision=5949 --- AUTHORS | 5 +++++ doc/ethereal.pod.template | 2 ++ packet-ppp.c | 10 +++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index d8428ae6f2..dc19bc0176 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1346,6 +1346,11 @@ Sergei Shokhor { Bugfix for EPM } +Hidetaka Ogawa { + Fix PPP FCS computation to include address and control field if + present +} + Alain Magloire was kind enough to give his permission to use his version of snprintf.c. diff --git a/doc/ethereal.pod.template b/doc/ethereal.pod.template index befe3dbe83..ee8e2958ff 100644 --- a/doc/ethereal.pod.template +++ b/doc/ethereal.pod.template @@ -1463,6 +1463,8 @@ B. Richard Urwin Prabhakar Krishnan Jim McDonough + Sergei Shokhor + Hidetaka Ogawa Alain Magloire was kind enough to give his permission to use his version of snprintf.c. diff --git a/packet-ppp.c b/packet-ppp.c index f28a173e2f..6cbd7f8098 100644 --- a/packet-ppp.c +++ b/packet-ppp.c @@ -1,7 +1,7 @@ /* packet-ppp.c * Routines for ppp packet disassembly * - * $Id: packet-ppp.c,v 1.94 2002/08/02 23:35:56 jmayer Exp $ + * $Id: packet-ppp.c,v 1.95 2002/08/04 08:44:27 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1291,7 +1291,7 @@ static guint16 fcs16(register guint16 fcs, tvbuff_t * tvbuff) { int offset = 0; - guint len = tvb_length(tvbuff); + guint len = tvb_length(tvbuff)-2; guint8 val; /* Check for Invalid Length */ @@ -1315,7 +1315,7 @@ static guint32 fcs32(guint32 fcs, tvbuff_t * tvbuff) { int offset = 0; - guint len = tvb_length(tvbuff); + guint len = tvb_length(tvbuff)-4; guint8 val; /* Check for invalid Length */ @@ -2702,7 +2702,7 @@ dissect_ppp_hdlc( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) * Compute the FCS and put it into the tree. */ rx_fcs_offset = proto_offset + len; - rx_fcs_exp = fcs16(0xFFFF, next_tvb); + rx_fcs_exp = fcs16(0xFFFF, tvb); rx_fcs_got = tvb_get_letohs(tvb, rx_fcs_offset); if (rx_fcs_got != rx_fcs_exp) { proto_tree_add_text(fh_tree, tvb, rx_fcs_offset, 2, @@ -2754,7 +2754,7 @@ dissect_ppp_hdlc( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) * Compute the FCS and put it into the tree. */ rx_fcs_offset = proto_offset + len; - rx_fcs_exp = fcs32(0xFFFFFFFF, next_tvb); + rx_fcs_exp = fcs32(0xFFFFFFFF, tvb); rx_fcs_got = tvb_get_letohl(tvb, rx_fcs_offset); if (rx_fcs_got != rx_fcs_exp) { proto_tree_add_text(fh_tree, tvb, rx_fcs_offset, 4,