aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/auth.c2
-rw-r--r--src/ban.c6
-rw-r--r--src/betab.c5
-rw-r--r--src/varnish-mib.82
-rw-r--r--src/varnish_mib.mib2c14
-rw-r--r--src/vcli.c2
7 files changed, 16 insertions, 17 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index a10abd1..3c066f1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
# This file is part of varnish-mib -*- automake -*-
-# Copyright (C) 2014 Sergey Poznyakoff
+# Copyright (C) 2014-2015 Sergey Poznyakoff
#
# varnish-mib is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/src/auth.c b/src/auth.c
index 9ef90ac..e9abbe4 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -1,5 +1,5 @@
/* This file is part of varnish-mib -*- c -*-
- Copyright (C) 2014 Sergey Poznyakoff
+ Copyright (C) 2014-2015 Sergey Poznyakoff
Varnish-mib is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/src/ban.c b/src/ban.c
index 70ca541..26dc5f4 100644
--- a/src/ban.c
+++ b/src/ban.c
@@ -1,5 +1,5 @@
/* This file is part of varnish-mib -*- c -*-
- Copyright (C) 2014 Sergey Poznyakoff
+ Copyright (C) 2014-2015 Sergey Poznyakoff
Varnish-mib is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -155,9 +155,11 @@ banTable_load(netsnmp_cache *cache, void *vmagic)
DEBUGMSGTL(("varnish_ban", "reloading ban table\n"));
vd = varnish_get_vsm_data();
+ if (!vd)
+ return SNMP_ERR_NOSUCHNAME;
rc = vcli_connect(vd, &conn);
if (rc != SNMP_ERR_NOERROR)
- return rc;
+ return rc;
if (vcli_asprintf(&conn, "ban.list\n") || vcli_write(&conn))
return SNMP_ERR_GENERR;
diff --git a/src/betab.c b/src/betab.c
index 41c18e7..b583958 100644
--- a/src/betab.c
+++ b/src/betab.c
@@ -223,9 +223,12 @@ create_entry_cb(void *priv, const struct VSC_point *const pt)
int
backendTable_load(netsnmp_cache *cache, void *vmagic)
{
- struct VSM_data *vd = varnish_get_vsm_data();
struct betab_priv bp;
+ struct VSM_data *vd = varnish_get_vsm_data();
+ if (!vd)
+ return SNMP_ERR_NOSUCHNAME;
+
bp.idx = -1;
bp.err = 0;
bp.table = (netsnmp_tdata *) vmagic;
diff --git a/src/varnish-mib.8 b/src/varnish-mib.8
index cc3276b..4559b0c 100644
--- a/src/varnish-mib.8
+++ b/src/varnish-mib.8
@@ -1,5 +1,5 @@
.\" This file is part of Varnish-mib -*- nroff -*-
-.\" Copyright (C) 2014 Sergey Poznyakoff
+.\" Copyright (C) 2014-2015 Sergey Poznyakoff
.\"
.\" Varnish-mib is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
diff --git a/src/varnish_mib.mib2c b/src/varnish_mib.mib2c
index ae344be..a5367e0 100644
--- a/src/varnish_mib.mib2c
+++ b/src/varnish_mib.mib2c
@@ -1,5 +1,5 @@
# This file is part of varnish-mib -*- c -*-
-# Copyright (C) 2014 Sergey Poznyakoff
+# Copyright (C) 2014-2015 Sergey Poznyakoff
#
# Varnish-mib is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -198,9 +198,6 @@ void
varnish_snmp_init(void)
{
vd = VSM_New();
-
- if (VSM_Open(vd))
- exit(1);
}
void
@@ -240,12 +237,9 @@ handle_$i(netsnmp_mib_handler *handler,
@startperl@
&{$vars{'varnish_translate'}}($vars{'i'});
@endperl@
-
- if (VSM_Abandoned(vd)) {
- DEBUGMSGTL(("$modulename", "reopening vd\n"));
- VSM_Close(vd);
- VSM_Open(vd);
- }
+
+ if (!varnish_get_vsm_data())
+ return SNMP_ERR_NOSUCHNAME;
switch(reqinfo->mode) {
case MODE_GET:
diff --git a/src/vcli.c b/src/vcli.c
index 76f869a..736d9b3 100644
--- a/src/vcli.c
+++ b/src/vcli.c
@@ -1,5 +1,5 @@
/* This file is part of varnish-mib -*- c -*-
- Copyright (C) 2014 Sergey Poznyakoff
+ Copyright (C) 2014-2015 Sergey Poznyakoff
Varnish-mib is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Return to:

Send suggestions and report system problems to the System administrator.