From bdbec30a849807fb5e6841a38cfe0d168e5962b9 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 21 Dec 2023 12:06:05 +0100 Subject: seitan: Add netlink, sendto()/sendmsg(), iovec handling, demo with routes A bit rough at the moment, but it does the trick. Bonus: setsockopt() (with magic values only, not used in any demo yet). Signed-off-by: Stefano Brivio --- cooker/parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cooker/parse.c') diff --git a/cooker/parse.c b/cooker/parse.c index 5d5cab3..8d0c20d 100644 --- a/cooker/parse.c +++ b/cooker/parse.c @@ -201,14 +201,14 @@ struct rule_parser { static union value value_get_set(struct num *desc, JSON_Array *set) { + union value n = { 0 }; struct num *tmp; - union value n; unsigned i; for (i = 0; i < json_array_get_count(set); i++) { for (tmp = desc; tmp->name; tmp++) { if (!strcmp(tmp->name, json_array_get_string(set, i))) { - n.v_num |= desc->value; + n.v_num |= tmp->value; break; } } @@ -364,6 +364,8 @@ static void parse_block(struct gluten_ctx *g, JSON_Object *block) unsigned i; memset(g->selected_arg, 0, sizeof(g->selected_arg)); + memset(g->match_dst, 0, sizeof(g->match_dst)); + memset(g->call_src, 0, sizeof(g->call_src)); memset(g->tags, 0, sizeof(g->tags)); g->lr = g->ip; -- cgit v1.2.3