From: Vincent Bernat Date: Wed, 3 Dec 2014 23:56:51 +0000 (+0100) Subject: lldpd: decrease probability of collisions on port checksums X-Git-Tag: 0.7.13~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e172ee7b999a9b6438284ec89e989a73eda4f3f3;p=thirdparty%2Flldpd.git lldpd: decrease probability of collisions on port checksums Instead of wasting a whole bit (getting 2**15 valid values), just waste one special value (2**16-1 valid values). --- diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index dfbce73c..8de5187b 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -315,7 +315,7 @@ lldpd_reset_timer(struct lldpd *cfg) /* Port change is detected by computing a checksum. 0 means the * checksum never was computed (new interface). */ cksum = frame_checksum(output, output_len, 0); - cksum |= 1; + cksum = cksum?cksum:1; free(output); if (cksum != hardware->h_lport_cksum) { log_debug("localchassis",