]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
cdp: Make it possible to enable CDPv2 without enabling CDPv1 71/head
authorMichel Stam <m.stam@fugro.nl>
Mon, 21 Jul 2014 15:30:28 +0000 (17:30 +0200)
committerMichel Stam <m.stam@fugro.nl>
Mon, 21 Jul 2014 15:30:28 +0000 (17:30 +0200)
src/daemon/lldpd.c

index 05e323a4c0ba328cc869082d926349b82dc6d35a..4848f6f3302ed3564a773d6a9ffaf6e7f6939e5f 100644 (file)
@@ -1598,6 +1598,16 @@ lldpd_main(int argc, char *argv[], char *envp[])
                        protos[i].enabled = 1;
                }
 
+               /* With -cccc disable CDPV1, enable CDPV2 */
+               if (protos[i].mode == LLDPD_MODE_CDPV1 && protos[i].enabled >= 4) {
+                       protos[i].enabled = 0;
+               }
+
+               /* With -cccc disable CDPV1, enable CDPV2; -ccccc will force CDPv2 */
+               if (protos[i].mode == LLDPD_MODE_CDPV2 && protos[i].enabled == 4) {
+                       protos[i].enabled = 1;
+               }
+
                if (protos[i].enabled > 1)
                        log_info("main", "protocol %s enabled and forced", protos[i].name);
                else if (protos[i].enabled)