summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-01-21 09:17:54 +0100
committerMaria Matejka <mq@ucw.cz>2019-02-20 22:30:54 +0100
commit9b46748d5b50d1e8c242a571e80fe1f9f33aeb73 (patch)
treeff2e6608d4a3dfc504039cde74864de030f8f898 /proto
parent4c553c5a5b40c21ba67bd82455e79678b204cd07 (diff)
Filter: refactoring of instruction constructors
Diffstat (limited to 'proto')
-rw-r--r--proto/static/config.Y12
1 files changed, 9 insertions, 3 deletions
diff --git a/proto/static/config.Y b/proto/static/config.Y
index 56caef24..527046ee 100644
--- a/proto/static/config.Y
+++ b/proto/static/config.Y
@@ -14,7 +14,7 @@ CF_DEFINES
#define STATIC_CFG ((struct static_config *) this_proto)
static struct static_route *this_srt, *this_snh;
-static struct f_inst *this_srt_cmds, **this_srt_last_cmd;
+static struct f_inst *this_srt_cmds, *this_srt_last_cmd;
static struct static_route *
static_nexthop_new(void)
@@ -111,7 +111,7 @@ stat_route0: ROUTE net_any {
add_tail(&STATIC_CFG->routes, &this_srt->n);
this_srt->net = $2;
this_srt_cmds = NULL;
- this_srt_last_cmd = &this_srt_cmds;
+ this_srt_last_cmd = NULL;
this_srt->mp_next = NULL;
this_snh = NULL;
}
@@ -137,7 +137,13 @@ stat_route:
;
stat_route_item:
- cmd { *this_srt_last_cmd = $1; this_srt_last_cmd = &($1->next); }
+ cmd {
+ if (this_srt_last_cmd)
+ f_inst_next(this_srt_last_cmd, $1);
+ else
+ this_srt_cmds = $1;
+ this_srt_last_cmd = $1;
+ }
;
stat_route_opts: