summaryrefslogtreecommitdiffstats
path: root/ospf6d
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 20:23:41 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-02-26 00:00:16 +0100
commit97b5d752d7af198d0b2881b5a3b2e61f2b4921e5 (patch)
tree1b29dd2d5a576a130532ebd349e66994ae196853 /ospf6d
parent*: remove unnecessary semicolon from switches (diff)
downloadfrr-97b5d752d7af198d0b2881b5a3b2e61f2b4921e5.tar.xz
frr-97b5d752d7af198d0b2881b5a3b2e61f2b4921e5.zip
*: use array_size instead of raw division
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_snmp.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c
index 376950e84..fc7c6177d 100644
--- a/ospf6d/ospf6_snmp.c
+++ b/ospf6d/ospf6_snmp.c
@@ -1358,13 +1358,10 @@ static int ospf6TrapNbrStateChange(struct ospf6_neighbor *on, int next_state,
index[1] = on->ospf6_if->instance_id;
index[2] = ntohl(on->router_id);
- smux_trap(ospfv3_variables,
- sizeof ospfv3_variables / sizeof(struct variable),
- ospfv3_trap_oid, sizeof ospfv3_trap_oid / sizeof(oid),
- ospfv3_oid, sizeof ospfv3_oid / sizeof(oid), index, 3,
- ospf6NbrTrapList,
- sizeof ospf6NbrTrapList / sizeof(struct trap_object),
- NBRSTATECHANGE);
+ smux_trap(ospfv3_variables, array_size(ospfv3_variables),
+ ospfv3_trap_oid, array_size(ospfv3_trap_oid), ospfv3_oid,
+ sizeof ospfv3_oid / sizeof(oid), index, 3, ospf6NbrTrapList,
+ array_size(ospf6NbrTrapList), NBRSTATECHANGE);
return 0;
}
@@ -1383,13 +1380,10 @@ static int ospf6TrapIfStateChange(struct ospf6_interface *oi, int next_state,
index[0] = oi->interface->ifindex;
index[1] = oi->instance_id;
- smux_trap(ospfv3_variables,
- sizeof ospfv3_variables / sizeof(struct variable),
- ospfv3_trap_oid, sizeof ospfv3_trap_oid / sizeof(oid),
- ospfv3_oid, sizeof ospfv3_oid / sizeof(oid), index, 2,
- ospf6IfTrapList,
- sizeof ospf6IfTrapList / sizeof(struct trap_object),
- IFSTATECHANGE);
+ smux_trap(ospfv3_variables, array_size(ospfv3_variables),
+ ospfv3_trap_oid, array_size(ospfv3_trap_oid), ospfv3_oid,
+ sizeof ospfv3_oid / sizeof(oid), index, 2, ospf6IfTrapList,
+ array_size(ospf6IfTrapList), IFSTATECHANGE);
return 0;
}