diff --git a/lib/packetfu/protos/lldp.rb b/lib/packetfu/protos/lldp.rb index da73d65..3d7a4ab 100644 --- a/lib/packetfu/protos/lldp.rb +++ b/lib/packetfu/protos/lldp.rb @@ -7,6 +7,7 @@ module PacketFu class LLDPPacket < Packet + MAGIC = Regexp.new("^\x01\x80\xc2\x00\x00[\x0e\x03\x00]", nil, "n") include ::PacketFu::EthHeaderMixin include ::PacketFu::LLDPHeaderMixin @@ -16,7 +17,7 @@ def self.can_parse?(str) return false unless EthPacket.can_parse? str return false unless str.size >= 6 return false unless str[12,2] == "\x88\xcc" - return false unless str =~ /^\x01\x80\xc2\x00\x00[\x0e\x03\x00]/ + return false unless str =~ MAGIC true end