]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Don't display debug message for valid but unsupported protocols like
authorVincent Bernat <bernat@luffy.cx>
Fri, 17 Oct 2008 21:08:39 +0000 (23:08 +0200)
committerVincent Bernat <bernat@luffy.cx>
Fri, 17 Oct 2008 21:08:39 +0000 (23:08 +0200)
DTP, VTP, ...

src/cdp.c
src/cdp.h

index 8d134890158469de88503e521b02aa0e27bd2ced..d2fb90e325724a56eaab71bc59ae71fd45697592 100644 (file)
--- a/src/cdp.c
+++ b/src/cdp.c
@@ -212,8 +212,15 @@ cdp_decode(struct lldpd *cfg, char *frame, int s,
                goto malformed;
        }
        if (llc->protoid != htons(LLC_PID_CDP)) {
-               LLOG_DEBUG("incorrect LLC protocol ID received on %s",
-                   hardware->h_ifname);
+               if ((llc->protoid != htons(LLC_PID_DRIP)) &&
+                   (llc->protoid != htons(LLC_PID_PAGP)) &&
+                   (llc->protoid != htons(LLC_PID_PVSTP)) &&
+                   (llc->protoid != htons(LLC_PID_UDLD)) &&
+                   (llc->protoid != htons(LLC_PID_VTP)) &&
+                   (llc->protoid != htons(LLC_PID_DTP)) &&
+                   (llc->protoid != htons(LLC_PID_STP)))
+                       LLOG_DEBUG("incorrect LLC protocol ID received on %s",
+                           hardware->h_ifname);
                goto malformed;
        }
        f = sizeof(struct ethllc);
index 634655cf2ee16463e8bd4bec2c8b289a3f0d74f5..c18ebdf6eb4571048d945a8dffdd7262e6f15ea4 100644 (file)
--- a/src/cdp.h
+++ b/src/cdp.h
 }
 #define LLC_ORG_CISCO { 0x00, 0x00, 0x0c }
 #define LLC_PID_CDP 0x2000
+/* Other protocols */
+#define LLC_PID_DRIP 0x102
+#define LLC_PID_PAGP 0x104
+#define LLC_PID_PVSTP 0x10b
+#define LLC_PID_UDLD 0x111
+#define LLC_PID_VTP 0x2003
+#define LLC_PID_DTP 0x2004
+#define LLC_PID_STP 0x200a
 
 struct cdp_header {
        u_int8_t        version;