Hi all,
I ran into a bug in discovery when it receives an LLDP packet with a vlan tag, the matcher takes into account the fact that it has the VLAN tag but the actual discovery code does not and throws an assertion error. This was happening in the .4 branch we have, but I checked and the code has not changed other than a delay value for .5, so it still seems vulnerable to the same problem. There also is a second assertion check after calling packet.next to verify the object is actually LLDP, negating the need for the first assertion.

diff --git a/src/nox/netapps/discovery/discovery.py b/src/nox/netapps/discovery/discovery.py
index 3ad0a7c..0a2de37 100644
--- a/src/nox/netapps/discovery/discovery.py
+++ b/src/nox/netapps/discovery/discovery.py
@@ -227,8 +227,9 @@ class discovery(Component):

def lldp_input_handler(self, dp_id, inport, ofp_reason, total_frame_len, buffer_id, packet):

-        assert (packet.type == ethernet.LLDP_TYPE)
-
+        if (packet.type == ethernet.VLAN_TYPE):
+            packet = packet.next
+
         if not packet.next:
             lg.error("lldp_input_handler lldp packet could not be parsed")
             return


Thanks,
David

_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to