From: Vincent Bernat Date: Mon, 17 Oct 2011 05:48:17 +0000 (+0200) Subject: snmp: use a 16-bit checksum, not a 15-bit one. X-Git-Tag: 0.5.5~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1066729b4f27ed979d871770a3f3a41c61a5ee2b;p=thirdparty%2Flldpd.git snmp: use a 16-bit checksum, not a 15-bit one. We could use a 31-bit checksum but we would have to write it. We prefer to minimize the code. --- diff --git a/src/agent.c b/src/agent.c index f182a92f..66c17742 100644 --- a/src/agent.c +++ b/src/agent.c @@ -492,7 +492,7 @@ header_ppiindexed_table(struct variable *vp, oid *name, size_t *length, TAILQ_FOREACH(pi, &hardware->h_lport.p_pids, p_entries) { current[0] = hardware->h_ifindex; current[1] = frame_checksum((const u_char*)pi->p_pi, - pi->p_pi_len, 0) & 0x8fff; + pi->p_pi_len, 0); if ((result = snmp_oid_compare(current, 2, target, target_len)) < 0) continue; @@ -551,7 +551,7 @@ header_tprpiindexed_table(struct variable *vp, oid *name, size_t *length, current[1] = hardware->h_ifindex; current[2] = port->p_chassis->c_index; current[1] = frame_checksum((const u_char *)pi->p_pi, - pi->p_pi_len, 0) & 0x8fff; + pi->p_pi_len, 0); if ((result = snmp_oid_compare(current, 4, target, target_len)) < 0) continue;