From 4d90d46894b92afc9fefe1b809b1d314fd1e5231 Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Sat, 22 Sep 2012 13:31:35 +0300 Subject: [PATCH] uplink config: Connect uplinks in the order defined in the config file (instead of the reverse order) --- src/config.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/config.c b/src/config.c index db26f64..7214f3e 100644 --- a/src/config.c +++ b/src/config.c @@ -650,10 +650,12 @@ int do_uplink(struct uplink_config_t **lq, int argc, char **argv) } } - /* put in the list */ - l->next = *lq; - if (l->next) - l->next->prevp = &l->next; + /* put in the end of the list */ + while (*lq) + lq = &(*lq)->next; + + l->prevp = lq; + l->next = NULL; *lq = l; return 0;