From: Vincent Bernat Date: Fri, 12 Apr 2013 06:32:25 +0000 (+0200) Subject: cdp: force CDPv2 protocol with `-ccc` argument X-Git-Tag: 0.7.2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43d109568939808e0c03d874a1d63857b45548a4;p=thirdparty%2Flldpd.git cdp: force CDPv2 protocol with `-ccc` argument --- diff --git a/NEWS b/NEWS index 27ac150e..508821eb 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ lldpd (0.7.2) + Lock BPF interfaces before handing them to chrooted process on BSD. + Limit the number of neighbors for each port to 4 (per protocol). + + Force CDPv2 protocol with argument `-ccc`. * Fixes: + Driver whitelisting is done before checking if an interface has a lower interface in Linux. diff --git a/src/daemon/lldpd.8 b/src/daemon/lldpd.8 index f2a2dfba..cfb0191f 100644 --- a/src/daemon/lldpd.8 +++ b/src/daemon/lldpd.8 @@ -154,7 +154,8 @@ using a TCP or UDP socket. .It Fl c Enable the support of CDP protocol to deal with Cisco routers that do not speak LLDP. If repeated, CDPv1 packets will be sent even when -there is no CDP peer detected. +there is no CDP peer detected. If repeated once again, CDPv2 packets +will be sent even when there is no CDP peer detected. .It Fl f Enable the support of FDP protocol to deal with Foundry routers that do not speak LLDP. If repeated, FDP packets will be sent even when there diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index bbeafc39..952587ac 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -1288,14 +1288,11 @@ lldpd_main(int argc, char *argv[]) found = 0; for (i=0; protos[i].mode != 0; i++) { if (ch == protos[i].arg) { - protos[i].enabled++; - protos[i].enabled %= 3; - /* When an argument enable - several protocols, only the - first one can be forced. */ - if (found && protos[i].enabled > 1) - protos[i].enabled = 1; - found = 1; + if (protos[i].enabled < 3) { + found = 1; + if (protos[i].enabled++ == 1) + break; + } } } if (!found)