aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pppoe.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2009-10-18 13:36:01 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2009-10-18 13:36:01 +0000
commit88099534302fa6459c95b6e3c2300c6e0466e54b (patch)
tree1de15846a51e631b1b4c20d7c6dda79ba1c61abc /epan/dissectors/packet-pppoe.c
parent34f6f0d9e97e71c3a0f419cc2a0662e5f51090ae (diff)
From Kip McAtee:
Suppress spurious packet length error message for LCP or IPCP in PPPoE. svn path=/trunk/; revision=30594
Diffstat (limited to 'epan/dissectors/packet-pppoe.c')
-rw-r--r--epan/dissectors/packet-pppoe.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/epan/dissectors/packet-pppoe.c b/epan/dissectors/packet-pppoe.c
index 213bcb1bec..6888ff6bff 100644
--- a/epan/dissectors/packet-pppoe.c
+++ b/epan/dissectors/packet-pppoe.c
@@ -33,6 +33,7 @@
#include <epan/etypes.h>
#include <epan/prefs.h>
#include <epan/expert.h>
+#include <epan/ppptypes.h>
static int proto_pppoed = -1;
@@ -701,6 +702,7 @@ static void dissect_pppoes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint actual_payload_length;
gint length, reported_length;
gint credit_offset = 0, tagstart = 0;
+ guint16 cp_code;
proto_tree *pppoe_tree;
proto_item *ti = NULL;
@@ -812,13 +814,21 @@ static void dissect_pppoes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* to the length field, *after* it does all the
* FCS heuristics.
*/
- if ((reported_payload_length != actual_payload_length) &&
- ((reported_payload_length + 4) != actual_payload_length)) {
- proto_item_append_text(ti, " [incorrect, should be %u]",
- actual_payload_length);
- expert_add_info_format(pinfo, ti, PI_MALFORMED,
- PI_WARN, "Possible bad payload length %u != %u",
- reported_payload_length, actual_payload_length);
+
+ /* retrieve the control protocol code if it's there */
+ cp_code = tvb_get_ntohs(tvb, 6);
+ /*
+ * The session payload length expressly does not include pad bytes
+ * when LCP or IPCP are present, so avoid the spurious error message
+ */
+ if ((cp_code != PPP_LCP) && (cp_code != PPP_IPCP) &&
+ (reported_payload_length != actual_payload_length) &&
+ ((reported_payload_length + 4) != actual_payload_length)) {
+ proto_item_append_text(ti, " [incorrect, should be %u]",
+ actual_payload_length);
+ expert_add_info_format(pinfo, ti, PI_MALFORMED,
+ PI_WARN, "Possible bad payload length %u != %u",
+ reported_payload_length, actual_payload_length);
}
}