From: Vincent Bernat Date: Sun, 15 Jun 2014 07:47:03 +0000 (+0200) Subject: cdp: don't expect and off-by-one checksum X-Git-Tag: 0.7.10~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=806eaef4832aebcf907b7b9cbf79f8cab5b24254;p=thirdparty%2Flldpd.git cdp: don't expect and off-by-one checksum --- diff --git a/NEWS b/NEWS index f5b2f661..11f52084 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ lldpd (0.7.10) * Features: + Ability to set promiscuous mode to work around bugs of some switches encapsulating LLDP frames inside 802.1Q frames. + * Fix: + + Fix checksum computation for Cisco CDP. lldpd (0.7.9) * Changes: diff --git a/src/daemon/cdp.c b/src/daemon/cdp.c index a66843c5..2ff57421 100644 --- a/src/daemon/cdp.c +++ b/src/daemon/cdp.c @@ -185,7 +185,7 @@ cdp_send(struct lldpd *global, goto toobig; } #endif - + /* Software version */ if (!( POKE_START_CDP_TLV(CDP_TLV_SOFTWARE) && @@ -331,8 +331,7 @@ cdp_decode(struct lldpd *cfg, char *frame, int s, 1 /* cisco checksum */ #endif ); - /* An off-by-one error may happen. Just ignore it */ - if ((cksum != 0) && (cksum != 0xfffe)) { + if (cksum != 0) { log_info("cdp", "incorrect CDP/FDP checksum for frame received on %s (%d)", hardware->h_ifname, cksum); goto malformed;