}
else if (strcmp(args[1], "table") == 0) {
s->data_state = DATA_ST_INIT;
- if (*args[2])
- s->data_ctx.table.target = findproxy(args[2], 0);
+ if (*args[2]) {
+ s->data_ctx.table.target = find_stktable(args[2]);
+ if (!s->data_ctx.table.target) {
+ s->data_ctx.cli.msg = "No such table\n";
+ si->st0 = STAT_CLI_PRINT;
+ return 1;
+ }
+ }
else
s->data_ctx.table.target = NULL;
s->data_ctx.table.proxy = NULL;
unsigned int ip_key;
if (!*args[2]) {
- s->data_ctx.cli.msg = "\"table\" argument expected.";
+ s->data_ctx.cli.msg = "\"table\" argument expected\n";
si->st0 = STAT_CLI_PRINT;
return 1;
}
px = find_stktable(args[2]);
if (!px) {
- s->data_ctx.cli.msg = "No such table.";
+ s->data_ctx.cli.msg = "No such table\n";
si->st0 = STAT_CLI_PRINT;
return 1;
}
if (strcmp(args[3], "key") != 0) {
- s->data_ctx.cli.msg = "\"key\" argument expected.";
+ s->data_ctx.cli.msg = "\"key\" argument expected\n";
si->st0 = STAT_CLI_PRINT;
return 1;
}
if (!*args[4]) {
- s->data_ctx.cli.msg = "Key value expected.";
+ s->data_ctx.cli.msg = "Key value expected\n";
si->st0 = STAT_CLI_PRINT;
return 1;
}
static_table_key.key = (void *)&ip_key;
}
else {
- s->data_ctx.cli.msg = "Removing keys from non-ip tables is not supported.";
+ s->data_ctx.cli.msg = "Removing keys from non-ip tables is not supported\n";
si->st0 = STAT_CLI_PRINT;
return 1;
}
}
else if (ts->ref_cnt) {
/* don't delete an entry which is currently referenced */
- s->data_ctx.cli.msg = "Entry currently in use, cannot remove.";
+ s->data_ctx.cli.msg = "Entry currently in use, cannot remove\n";
si->st0 = STAT_CLI_PRINT;
return 1;
}