diff options
author | Patrick McHardy <kaber@trash.net> | 2013-04-18 17:53:59 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2013-04-18 17:53:59 +0200 |
commit | e19e0ed6cde3176b7ef519748f893aa1afc86fa7 (patch) | |
tree | 4c13f623c1fbcb1d5f199f3031a9d19659ecea91 /src/parser.y | |
parent | 18dfaeb51b7f6205a61925c97053a7fad4dfafc0 (diff) |
cmd/netlink: make sure we always have a location in netlink operations
Improve error reporting by always using a location in netlink operations.
Signed-off-by: Patrick McHardy<kaber@trash.net>
Diffstat (limited to 'src/parser.y')
-rw-r--r-- | src/parser.y | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/parser.y b/src/parser.y index 87602d9f..166cbcc5 100644 --- a/src/parser.y +++ b/src/parser.y @@ -526,121 +526,121 @@ base_cmd : /* empty */ add_cmd { $$ = $1; } add_cmd : TABLE table_spec { - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_TABLE, &$2, NULL); + $$ = cmd_alloc(CMD_ADD, CMD_OBJ_TABLE, &$2, &@$, NULL); } | TABLE table_spec table_block_alloc '{' table_block '}' { handle_merge(&$3->handle, &$2); close_scope(state); - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_TABLE, &$2, $5); + $$ = cmd_alloc(CMD_ADD, CMD_OBJ_TABLE, &$2, &@$, $5); } | CHAIN chain_spec { - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_CHAIN, &$2, NULL); + $$ = cmd_alloc(CMD_ADD, CMD_OBJ_CHAIN, &$2, &@$, NULL); } | CHAIN chain_spec chain_block_alloc '{' chain_block '}' { handle_merge(&$3->handle, &$2); close_scope(state); - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_CHAIN, &$2, $5); + $$ = cmd_alloc(CMD_ADD, CMD_OBJ_CHAIN, &$2, &@$, $5); } | RULE ruleid_spec rule { - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_RULE, &$2, $3); + $$ = cmd_alloc(CMD_ADD, CMD_OBJ_RULE, &$2, &@$, $3); } | /* empty */ ruleid_spec rule { - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_RULE, &$1, $2); + $$ = cmd_alloc(CMD_ADD, CMD_OBJ_RULE, &$1, &@$, $2); } | SET set_spec set_block_alloc '{' set_block '}' { $5->location = @5; handle_merge(&$3->handle, &$2); - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_SET, &$2, $5); + $$ = cmd_alloc(CMD_ADD, CMD_OBJ_SET, &$2, &@$, $5); } | MAP set_spec map_block_alloc '{' map_block '}' { $5->location = @5; handle_merge(&$3->handle, &$2); - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_SET, &$2, $5); + $$ = cmd_alloc(CMD_ADD, CMD_OBJ_SET, &$2, &@$, $5); } | ELEMENT set_spec set_expr { - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_SETELEM, &$2, $3); + $$ = cmd_alloc(CMD_ADD, CMD_OBJ_SETELEM, &$2, &@$, $3); } ; insert_cmd : RULE ruleid_spec rule { - $$ = cmd_alloc(CMD_INSERT, CMD_OBJ_RULE, &$2, $3); + $$ = cmd_alloc(CMD_INSERT, CMD_OBJ_RULE, &$2, &@$, $3); } ; delete_cmd : TABLE table_spec { - $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_TABLE, &$2, NULL); + $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_TABLE, &$2, &@$, NULL); } | CHAIN chain_spec { - $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_CHAIN, &$2, NULL); + $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_CHAIN, &$2, &@$, NULL); } | RULE ruleid_spec { - $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_RULE, &$2, NULL); + $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_RULE, &$2, &@$, NULL); } | SET set_spec { - $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SET, &$2, NULL); + $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SET, &$2, &@$, NULL); } | ELEMENT set_spec set_expr { - $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SETELEM, &$2, $3); + $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SETELEM, &$2, &@$, $3); } ; list_cmd : TABLE table_spec { - $$ = cmd_alloc(CMD_LIST, CMD_OBJ_TABLE, &$2, NULL); + $$ = cmd_alloc(CMD_LIST, CMD_OBJ_TABLE, &$2, &@$, NULL); } | TABLES tables_spec { - $$ = cmd_alloc(CMD_LIST, CMD_OBJ_TABLE, &$2, NULL); + $$ = cmd_alloc(CMD_LIST, CMD_OBJ_TABLE, &$2, &@$, NULL); } | CHAIN chain_spec { - $$ = cmd_alloc(CMD_LIST, CMD_OBJ_CHAIN, &$2, NULL); + $$ = cmd_alloc(CMD_LIST, CMD_OBJ_CHAIN, &$2, &@$, NULL); } | SETS table_spec { - $$ = cmd_alloc(CMD_LIST, CMD_OBJ_SETS, &$2, NULL); + $$ = cmd_alloc(CMD_LIST, CMD_OBJ_SETS, &$2, &@$, NULL); } | SET set_spec { - $$ = cmd_alloc(CMD_LIST, CMD_OBJ_SET, &$2, NULL); + $$ = cmd_alloc(CMD_LIST, CMD_OBJ_SET, &$2, &@$, NULL); } ; flush_cmd : TABLE table_spec { - $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_TABLE, &$2, NULL); + $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_TABLE, &$2, &@$, NULL); } | CHAIN chain_spec { - $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_CHAIN, &$2, NULL); + $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_CHAIN, &$2, &@$, NULL); } | SET set_spec { - $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_SET, &$2, NULL); + $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_SET, &$2, &@$, NULL); } ; rename_cmd : CHAIN chain_spec identifier { - $$ = cmd_alloc(CMD_RENAME, CMD_OBJ_CHAIN, &$2, NULL); + $$ = cmd_alloc(CMD_RENAME, CMD_OBJ_CHAIN, &$2, &@$, NULL); $$->arg = $3; } ; |