summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-07-24 15:38:32 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-07-24 15:38:32 +0200
commitcec40a74679821513e627f93b924067a404f6475 (patch)
tree793bbe5b326e7008e4657cf11b2937cafbe3d922 /sysdep/unix
parent18f70a6229f586d5e4f387075be42d7a1ef5d269 (diff)
parent8263690e754a83b8f3c58bd0080a1628d6cba556 (diff)
Merge remote-tracking branch 'origin/mq-filter-stack'
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/io.c2
-rw-r--r--sysdep/unix/krt.c2
-rw-r--r--sysdep/unix/main.c9
3 files changed, 6 insertions, 7 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 3a1e22c5..c9fee3ab 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -132,7 +132,7 @@ times_init(struct timeloop *loop)
if (rv < 0)
die("Monotonic clock is missing");
- if ((ts.tv_sec < 0) || (((s64) ts.tv_sec) > ((s64) 1 << 40)))
+ if ((ts.tv_sec < 0) || (((u64) ts.tv_sec) > ((u64) 1 << 40)))
log(L_WARN "Monotonic clock is crazy");
loop->last_time = ts.tv_sec S + ts.tv_nsec NS;
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index f0e78442..27868fab 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -562,7 +562,7 @@ static struct rte *
krt_export_net(struct krt_proto *p, net *net, rte **rt_free)
{
struct channel *c = p->p.main_channel;
- struct filter *filter = c->out_filter;
+ const struct filter *filter = c->out_filter;
rte *rt;
if (c->ra_mode == RA_MERGED)
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index 39465aa8..05becbe7 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -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