diff options
author | Jorge Boncompte [DTI2] <jorge@dti2.net> | 2012-04-09 18:03:57 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2012-04-16 18:37:17 +0200 |
commit | 7939e016b3d4ecd2f5b8ad708b69607e05a084a6 (patch) | |
tree | eb33846c71de49df9d1128eec149f2a214bb74f9 /ospfd | |
parent | 3cadc0cdebb8f8262b1c1fbb8bfcbcdc3baa3733 (diff) |
ospfd: Fixes a crash of the daemon with a snmp walk
- And allows to walk the LSDB.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_snmp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index cc4974ce..9c9dd47a 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -934,7 +934,7 @@ ospfLsdbLookup (struct variable *v, oid *name, size_t *length, struct ospf *ospf; struct ospf_area *area; struct ospf_lsa *lsa; - unsigned int len; + int len; int type_next; int ls_id_next; int router_id_next; @@ -992,7 +992,7 @@ ospfLsdbLookup (struct variable *v, oid *name, size_t *length, if (len == IN_ADDR_SIZE) area = ospf_area_lookup_by_area_id (ospf, *area_id); else - area = ospf_area_lookup_next (ospf, area_id, len == 0 ? 1 : 0); + area = ospf_area_lookup_next (ospf, area_id, 1); if (area == NULL) return NULL; @@ -1000,8 +1000,8 @@ ospfLsdbLookup (struct variable *v, oid *name, size_t *length, do { /* Next we lookup type. */ - offset += IN_ADDR_SIZE; - offsetlen -= IN_ADDR_SIZE; + offset += len; + offsetlen -= len; len = offsetlen; if (len <= 0) |