diff options
Diffstat (limited to 'src/ban.c')
-rw-r--r-- | src/ban.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -38,7 +38,7 @@ send_ban_cmd(vcli_conn_t *conn, const char *expr) | |||
38 | int | 38 | int |
39 | varnish_ban(netsnmp_agent_request_info *reqinfo, | 39 | varnish_ban(netsnmp_agent_request_info *reqinfo, |
40 | netsnmp_request_info *requests, | 40 | netsnmp_request_info *requests, |
41 | struct VSM_data *vd) | 41 | struct vsm *vsm) |
42 | { | 42 | { |
43 | int rc; | 43 | int rc; |
44 | struct vcli_conn conn; | 44 | struct vcli_conn conn; |
@@ -52,7 +52,7 @@ varnish_ban(netsnmp_agent_request_info *reqinfo, | |||
52 | memcpy(expr, requests->requestvb->val.string, len); | 52 | memcpy(expr, requests->requestvb->val.string, len); |
53 | expr[len] = 0; | 53 | expr[len] = 0; |
54 | DEBUGMSGTL(("varnish_ban", "setting ban %s\n", expr)); | 54 | DEBUGMSGTL(("varnish_ban", "setting ban %s\n", expr)); |
55 | rc = vcli_connect(vd, &conn); | 55 | rc = vcli_connect(vsm, &conn); |
56 | if (rc == SNMP_ERR_NOERROR) { | 56 | if (rc == SNMP_ERR_NOERROR) { |
57 | rc = send_ban_cmd(&conn, expr); | 57 | rc = send_ban_cmd(&conn, expr); |
58 | vcli_disconnect(&conn); | 58 | vcli_disconnect(&conn); |
@@ -151,13 +151,14 @@ banTable_load(netsnmp_cache *cache, void *vmagic) | |||
151 | int rc; | 151 | int rc; |
152 | struct vcli_conn conn; | 152 | struct vcli_conn conn; |
153 | char *p; | 153 | char *p; |
154 | struct VSM_data *vd; | 154 | |
155 | struct vsm *vsm = varnish_get_vsm_data(); | ||
156 | if (!vsm) | ||
157 | return SNMP_ERR_GENERR; | ||
155 | 158 | ||
156 | DEBUGMSGTL(("varnish_ban", "reloading ban table\n")); | 159 | DEBUGMSGTL(("varnish_ban", "reloading ban table\n")); |
157 | vd = varnish_get_vsm_data(); | 160 | rc = vcli_connect(vsm, &conn); |
158 | if (!vd) | 161 | |
159 | return SNMP_ERR_NOSUCHNAME; | ||
160 | rc = vcli_connect(vd, &conn); | ||
161 | if (rc != SNMP_ERR_NOERROR) | 162 | if (rc != SNMP_ERR_NOERROR) |
162 | return rc; | 163 | return rc; |
163 | 164 | ||