From: Michel Stam Date: Mon, 21 Jul 2014 15:30:28 +0000 (+0200) Subject: cdp: Make it possible to enable CDPv2 without enabling CDPv1 X-Git-Tag: 0.7.10~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F71%2Fhead;p=thirdparty%2Flldpd.git cdp: Make it possible to enable CDPv2 without enabling CDPv1 --- diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index 05e323a4..4848f6f3 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -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)