diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index 56c2cda..4e915f4 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -534,6 +534,9 @@ pf_iftable(struct snmp_context __unused *ctx, struct snmp_value *val, asn_subid_t which = val->var.subs[sub - 1]; struct pfi_entry *e = NULL; + if ((time(NULL) - pfi_table_age) > PFI_TABLE_MAXAGE) + pfi_refresh(); + switch (op) { case SNMP_OP_SET: return (SNMP_ERR_NOT_WRITEABLE); @@ -557,9 +560,6 @@ pf_iftable(struct snmp_context __unused *ctx, struct snmp_value *val, abort(); } - if ((time(NULL) - pfi_table_age) > PFI_TABLE_MAXAGE) - pfi_refresh(); - switch (which) { case LEAF_pfInterfacesIfDescr: return (string_get(val, e->pfi.pfik_name, -1)); @@ -684,6 +684,9 @@ pf_tbltable(struct snmp_context __unused *ctx, struct snmp_value *val, asn_subid_t which = val->var.subs[sub - 1]; struct pft_entry *e = NULL; + if ((time(NULL) - pft_table_age) > PFT_TABLE_MAXAGE) + pft_refresh(); + switch (op) { case SNMP_OP_SET: return (SNMP_ERR_NOT_WRITEABLE); @@ -707,9 +710,6 @@ pf_tbltable(struct snmp_context __unused *ctx, struct snmp_value *val, abort(); } - if ((time(NULL) - pft_table_age) > PFT_TABLE_MAXAGE) - pft_refresh(); - switch (which) { case LEAF_pfTablesTblDescr: return (string_get(val, e->pft.pfrts_name, -1)); @@ -842,6 +842,9 @@ pf_altqq(struct snmp_context __unused *ctx, struct snmp_value *val, return (SNMP_ERR_NOERROR); } + if ((time(NULL) - pfq_table_age) > PFQ_TABLE_MAXAGE) + pfq_refresh(); + switch (op) { case SNMP_OP_SET: return (SNMP_ERR_NOT_WRITEABLE); @@ -865,9 +868,6 @@ pf_altqq(struct snmp_context __unused *ctx, struct snmp_value *val, abort(); } - if ((time(NULL) - pfq_table_age) > PFQ_TABLE_MAXAGE) - pfq_refresh(); - switch (which) { case LEAF_pfAltqQueueDescr: return (string_get(val, e->altq.qname, -1)); @@ -930,6 +930,9 @@ pf_lbltable(struct snmp_context __unused *ctx, struct snmp_value *val, asn_subid_t which = val->var.subs[sub - 1]; struct pfl_entry *e = NULL; + if ((time(NULL) - pfl_table_age) > PFL_TABLE_MAXAGE) + pfl_refresh(); + switch (op) { case SNMP_OP_SET: return (SNMP_ERR_NOT_WRITEABLE); @@ -953,9 +956,6 @@ pf_lbltable(struct snmp_context __unused *ctx, struct snmp_value *val, abort(); } - if ((time(NULL) - pfl_table_age) > PFL_TABLE_MAXAGE) - pfl_refresh(); - switch (which) { case LEAF_pfLabelsLblName: return (string_get(val, e->name, -1)); |