Skip to content

Commit

Permalink
Fix SAPRouter control messages
Browse files Browse the repository at this point in the history
Even when control text length is 0, the packet contains the eyecatcher string ("*ERR"). Pointed out by Mathieu Geli in #10! Thanks!
  • Loading branch information
Martin Gallo committed Feb 17, 2017
1 parent 59f2e9e commit c303c9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pysap/SAPRouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class SAPRouter(Packet):

# Control Message fields
ConditionalField(IntField("control_text_length", 0), lambda pkt: router_is_control(pkt) and pkt.opcode != 0),
ConditionalField(StrField("control_text_value", "*ERR"), lambda pkt: router_is_control(pkt) and pkt.opcode != 0 and pkt.control_text_length > 0),
ConditionalField(StrField("control_text_value", "*ERR"), lambda pkt: router_is_control(pkt) and pkt.opcode != 0),

# SNC Frame fields
ConditionalField(PacketField("snc_frame", None, SAPSNCFrame), lambda pkt: router_is_control(pkt) and pkt.opcode in [70, 71])
Expand Down

0 comments on commit c303c9f

Please sign in to comment.