2005-09-29 Alain Ritoux <alain.ritoux@6wind.com>
* 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
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index 4ed1fab..d0c1290 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -1,4 +1,5 @@
/* OSPFv2 SNMP support
+ * Copyright (C) 2005 6WIND <alain.ritoux@6wind.com>
* Copyright (C) 2000 IP Infusion Inc.
*
* Written by Kunihiro Ishiguro <kunihiro@zebra.org>
@@ -885,6 +886,14 @@
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 @@
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));