Skip to content

Commit fa8e8b3

Browse files
committed
router_config: fix data type for linked list
Signed-off-by: Eduardo Silva <[email protected]>
1 parent 68b7efb commit fa8e8b3

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/flb_router_config.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,15 +1207,15 @@ static struct flb_output_instance *find_output_instance(struct flb_config *confi
12071207
static int input_has_direct_route(struct flb_input_instance *in,
12081208
struct flb_output_instance *out)
12091209
{
1210-
struct mk_list *head;
1210+
struct cfl_list *head;
12111211
struct flb_router_path *path;
12121212

12131213
if (!in || !out) {
12141214
return FLB_FALSE;
12151215
}
12161216

1217-
mk_list_foreach(head, &in->routes_direct) {
1218-
path = mk_list_entry(head, struct flb_router_path, _head);
1217+
cfl_list_foreach(head, &in->routes_direct) {
1218+
path = cfl_list_entry(head, struct flb_router_path, _head);
12191219
if (path->ins == out) {
12201220
return FLB_TRUE;
12211221
}
@@ -1251,6 +1251,7 @@ static int output_supports_signals(struct flb_output_instance *out, uint32_t sig
12511251

12521252
int flb_router_apply_config(struct flb_config *config)
12531253
{
1254+
int created = 0;
12541255
struct cfl_list *input_head;
12551256
struct cfl_list *route_head;
12561257
struct cfl_list *output_head;
@@ -1260,15 +1261,12 @@ int flb_router_apply_config(struct flb_config *config)
12601261
struct flb_input_instance *input_ins;
12611262
struct flb_output_instance *output_ins;
12621263
struct flb_output_instance *fallback_ins;
1263-
int created;
1264+
struct flb_router_path *path;
12641265

12651266
if (!config) {
12661267
return 0;
12671268
}
12681269

1269-
flb_debug("[router] applying router configuration");
1270-
created = 0;
1271-
12721270
cfl_list_foreach(input_head, &config->input_routes) {
12731271
input_routes = cfl_list_entry(input_head, struct flb_input_routes, _head);
12741272

@@ -1318,10 +1316,7 @@ int flb_router_apply_config(struct flb_config *config)
13181316
}
13191317

13201318
if (flb_router_connect_direct(input_ins, output_ins) == 0) {
1321-
struct flb_router_path *path;
1322-
1323-
path = mk_list_entry_last(&input_ins->routes_direct,
1324-
struct flb_router_path, _head);
1319+
path = cfl_list_entry_last(&input_ins->routes_direct, struct flb_router_path, _head);
13251320
path->route = route;
13261321
created++;
13271322
flb_debug("[router] connected input '%s' route '%s' to output '%s'",

0 commit comments

Comments
 (0)