]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_snmp.c
Merge pull request #12967 from pguibert6WIND/show_zebra_mpls_empty
[mirror_frr.git] / ospf6d / ospf6_snmp.c
index dcf76c7038e6d50e9d30556377fdf3b3d65f3318..46fa27dd9e931e031030fce8f60d3d42086dbdf6 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* OSPFv3 SNMP support
  * Copyright (C) 2004 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -664,9 +649,10 @@ static uint8_t *ospfv3GeneralGroup(struct variable *v, oid *name,
                return SNMP_INTEGER(3);
        case OSPFv3AREABDRRTRSTATUS:
                if (ospf6)
-                       return SNMP_INTEGER(ospf6_is_router_abr(ospf6)
-                                                   ? SNMP_TRUE
-                                                   : SNMP_FALSE);
+                       return SNMP_INTEGER(
+                               ospf6_check_and_set_router_abr(ospf6)
+                                       ? SNMP_TRUE
+                                       : SNMP_FALSE);
                return SNMP_INTEGER(SNMP_FALSE);
        case OSPFv3ASBDRRTRSTATUS:
                if (ospf6)
@@ -970,8 +956,7 @@ static uint8_t *ospfv3WwLsdbEntry(struct variable *v, oid *name, size_t *length,
                        for (ALL_LIST_ELEMENTS_RO(ifslist, node, iif)) {
                                if (!iif->ifindex)
                                        continue;
-                               oi = ospf6_interface_lookup_by_ifindex(
-                                       iif->ifindex, iif->vrf_id);
+                               oi = iif->info;
                                if (!oi)
                                        continue;
                                if (iif->ifindex < ifindex)
@@ -1038,7 +1023,6 @@ static uint8_t *ospfv3WwLsdbEntry(struct variable *v, oid *name, size_t *length,
                return SNMP_INTEGER(OSPF6_LSA_IS_KNOWN(lsa->header->type)
                                            ? SNMP_TRUE
                                            : SNMP_FALSE);
-               break;
        }
        return NULL;
 }
@@ -1106,8 +1090,7 @@ static uint8_t *ospfv3IfEntry(struct variable *v, oid *name, size_t *length,
                for (ALL_LIST_ELEMENTS_RO(ifslist, i, iif)) {
                        if (!iif->ifindex)
                                continue;
-                       oi = ospf6_interface_lookup_by_ifindex(iif->ifindex,
-                                                              iif->vrf_id);
+                       oi = iif->info;
                        if (!oi)
                                continue;
                        if (iif->ifindex > ifindex
@@ -1272,8 +1255,7 @@ static uint8_t *ospfv3NbrEntry(struct variable *v, oid *name, size_t *length,
                for (ALL_LIST_ELEMENTS_RO(ifslist, i, iif)) {
                        if (!iif->ifindex)
                                continue;
-                       oi = ospf6_interface_lookup_by_ifindex(iif->ifindex,
-                                                              iif->vrf_id);
+                       oi = iif->info;
                        if (!oi)
                                continue;
                        for (ALL_LIST_ELEMENTS_RO(oi->neighbor_list, j, on)) {