From ba682537715c42ab3976790baea5cda86c5b1589 Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 29 Sep 2005 13:52:57 +0000 Subject: 2005-09-29 Alain Ritoux * ospfd/ospf_vty.c: forece default route LSA to be re_issued whenever cost is changed ( [no] ip ospf area XXX default-cost YYY) Support ignore-mtu option * ospfd/ospfd.h: define OSPF_MTU_IGNORE_DEFAULT * ospfd/ospf_packet.c: support ignore-mtu option * ospfd/ospf_interface.h: field added for skipping MTU check * ospfd/ospf_interface.c: fix memory leak in ospf_crypt_key_delete() Set mtu_ignore field to default value * ospfd/ospf_abr.[ch]: export ospf_abr_announce_network_to_area() * ospfd/ospf_ism.h: add MACRO to convert internal ISM status into SNMP correct values * ospfd/ospf_snmp.c: add sanity check on LSA type in lsdb_lookup_next() convert OSPFIFSTATE internal status into SNMP values --- ospfd/ospf_snmp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ospfd/ospf_snmp.c') diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index 4ed1fab8..d0c12907 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -1,4 +1,5 @@ /* OSPFv2 SNMP support + * Copyright (C) 2005 6WIND * Copyright (C) 2000 IP Infusion Inc. * * Written by Kunihiro Ishiguro @@ -885,6 +886,14 @@ lsdb_lookup_next (struct ospf_area *area, u_char *type, int type_next, else i = *type; + /* Sanity check, if LSA type unknwon + merley skip any LSA */ + if ((i < OSPF_MIN_LSA) || (i >= OSPF_MAX_LSA)) + { + zlog_debug("Strange request with LSA type %d\n", i); + return NULL; + } + for (; i < OSPF_MAX_LSA; i++) { *type = i; @@ -1673,7 +1682,7 @@ ospfIfEntry (struct variable *v, oid *name, size_t *length, int exact, return SNMP_INTEGER (OSPF_POLL_INTERVAL_DEFAULT); break; case OSPFIFSTATE: /* 12 */ - return SNMP_INTEGER (oi->state); + return SNMP_INTEGER (ISM_SNMP(oi->state)); break; case OSPFIFDESIGNATEDROUTER: /* 13 */ return SNMP_IPADDRESS (DR (oi)); -- cgit v1.2.1