]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_snmp.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / isisd / isis_snmp.c
index c530eb9169061a6c7528b575be29dbe15f381a3e..ae570a0864d1b058aa112fe9fa9e7a1493dc9c99 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * ISIS SNMP support
  * Copyright (C) 2020 Volta Networks, Inc.
  *                    Aleksey Romanov
- *
- * This program 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 of the License, or (at your option)
- * any later version.
- *
- * This program 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
  */
 
 /*
@@ -37,6 +24,7 @@
 #include "smux.h"
 #include "libfrr.h"
 #include "lib/version.h"
+#include "lib/zclient.h"
 
 #include "isisd/isis_constants.h"
 #include "isisd/isis_common.h"
@@ -1186,14 +1174,13 @@ static int isis_snmp_adj_helper(struct isis_adjacency *adj, int data_id,
                break;
 
        case ISIS_SNMP_ADJ_DATA_IP_ADDR:
-               if (data_off
-                   >= (adj->ipv4_address_count + adj->ipv6_address_count))
+               if (data_off >= (adj->ipv4_address_count + adj->ll_ipv6_count))
                        return 0;
 
                if (data_off >= adj->ipv4_address_count) {
-                       data = (uint8_t *)&adj->ipv6_addresses
+                       data = (uint8_t *)&adj->ll_ipv6_addrs
                                       [data_off - adj->ipv4_address_count];
-                       data_len = sizeof(adj->ipv6_addresses[0]);
+                       data_len = sizeof(adj->ll_ipv6_addrs[0]);
                } else {
                        data = (uint8_t *)&adj->ipv4_addresses[data_off];
                        data_len = sizeof(adj->ipv4_addresses[0]);
@@ -2117,7 +2104,7 @@ static uint8_t *isis_snmp_find_circ(struct variable *v, oid *name,
 
        switch (v->magic) {
        case ISIS_CIRC_IFINDEX:
-               if (circuit->interface == 0)
+               if (circuit->interface == NULL)
                        return SNMP_INTEGER(0);
 
                return SNMP_INTEGER(circuit->interface->ifindex);