]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
snmp: use a 16-bit checksum, not a 15-bit one.
authorVincent Bernat <bernat@luffy.cx>
Mon, 17 Oct 2011 05:48:17 +0000 (07:48 +0200)
committerVincent Bernat <bernat@luffy.cx>
Mon, 17 Oct 2011 05:48:17 +0000 (07:48 +0200)
We could use a 31-bit checksum but we would have to write it. We
prefer to minimize the code.

src/agent.c

index f182a92f0b5154788b4ace6f17e2155aaeae509a..66c177424a014508d108c3170cf8d8d5e5d3a218 100644 (file)
@@ -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;