From de7a6a260b1624b5273766ea70b9b17afa9d6634 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Mon, 5 Dec 2022 11:50:12 +0000 Subject: Revert and adjust the changes in ometric_set_state() from last commit. Calling ometric_set_int_with_labels() for a state metric fails because there is a check in ometric_set_int comparing the type. Use olabels_add_extras() and ometric_set_int_value() instead. --- usr.sbin/bgpctl/ometric.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/bgpctl/ometric.c b/usr.sbin/bgpctl/ometric.c index 37abc64fd0f..296c08026d3 100644 --- a/usr.sbin/bgpctl/ometric.c +++ b/usr.sbin/bgpctl/ometric.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ometric.c,v 1.4 2022/12/01 09:14:40 claudio Exp $ */ +/* $OpenBSD: ometric.c,v 1.5 2022/12/05 11:50:11 claudio Exp $ */ /* * Copyright (c) 2022 Claudio Jeker @@ -390,6 +390,7 @@ ometric_set_info(struct ometric *om, const char **keys, const char **values, void ometric_set_state(struct ometric *om, const char *state, struct olabels *ol) { + struct olabels *extra; size_t i; int val; @@ -402,8 +403,10 @@ ometric_set_state(struct ometric *om, const char *state, struct olabels *ol) else val = 0; - ometric_set_int_with_labels(om, val, OKV(om->name), - OKV(om->stateset[i]), ol); + extra = olabels_add_extras(ol, OKV(om->name), + OKV(om->stateset[i])); + ometric_set_int_value(om, val, extra); + olabels_free(extra); } } -- cgit v1.2.3