]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - sysdep/unix/main.c
Merge branch 'master' into mq-filter-stack
[thirdparty/bird.git] / sysdep / unix / main.c
index 39465aa8821c5036f3bc444dbc86475e6143ae1c..05becbe75f6a57c84c69b84aa92803458db44225 100644 (file)
@@ -36,6 +36,7 @@
 #include "nest/locks.h"
 #include "conf/conf.h"
 #include "filter/filter.h"
+#include "filter/data.h"
 
 #include "unix.h"
 #include "krt.h"
@@ -93,11 +94,9 @@ drop_gid(gid_t gid)
 static inline void
 add_num_const(char *name, int val)
 {
-  struct symbol *s = cf_get_symbol(name);
-  s->class = SYM_CONSTANT | T_INT;
-  s->def = cfg_allocz(sizeof(struct f_val));
-  SYM_TYPE(s) = T_INT;
-  SYM_VAL(s).i = val;
+  struct f_val *v = cfg_alloc(sizeof(struct f_val));
+  *v = (struct f_val) { .type = T_INT, .val.i = val };
+  cf_define_symbol(cf_get_symbol(name), SYM_CONSTANT | T_INT, val, v);
 }
 
 /* the code of read_iproute_table() is based on