summaryrefslogtreecommitdiffabout
path: root/src/ban.c
Side-by-side diff
Diffstat (limited to 'src/ban.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/ban.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/ban.c b/src/ban.c
index 26dc5f4..0c354e9 100644
--- a/src/ban.c
+++ b/src/ban.c
@@ -38,7 +38,7 @@ send_ban_cmd(vcli_conn_t *conn, const char *expr)
int
varnish_ban(netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests,
- struct VSM_data *vd)
+ struct vsm *vsm)
{
int rc;
struct vcli_conn conn;
@@ -52,7 +52,7 @@ varnish_ban(netsnmp_agent_request_info *reqinfo,
memcpy(expr, requests->requestvb->val.string, len);
expr[len] = 0;
DEBUGMSGTL(("varnish_ban", "setting ban %s\n", expr));
- rc = vcli_connect(vd, &conn);
+ rc = vcli_connect(vsm, &conn);
if (rc == SNMP_ERR_NOERROR) {
rc = send_ban_cmd(&conn, expr);
vcli_disconnect(&conn);
@@ -151,13 +151,14 @@ banTable_load(netsnmp_cache *cache, void *vmagic)
int rc;
struct vcli_conn conn;
char *p;
- struct VSM_data *vd;
+
+ struct vsm *vsm = varnish_get_vsm_data();
+ if (!vsm)
+ return SNMP_ERR_GENERR;
DEBUGMSGTL(("varnish_ban", "reloading ban table\n"));
- vd = varnish_get_vsm_data();
- if (!vd)
- return SNMP_ERR_NOSUCHNAME;
- rc = vcli_connect(vd, &conn);
+ rc = vcli_connect(vsm, &conn);
+
if (rc != SNMP_ERR_NOERROR)
return rc;

Return to:

Send suggestions and report system problems to the System administrator.