Commit 338a07cd authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement merge_nconf.

This had never been implemented, we were silently ignoring duplicate
configuration lines.
parent 8aea90e5
......@@ -24,6 +24,7 @@ THE SOFTWARE.
#include <string.h>
#include <stdio.h>
#include <sys/time.h>
#include <assert.h>
#ifdef __linux
/* Defining it rather than including <linux/rtnetlink.h> because this
......@@ -472,7 +473,22 @@ add_filter(struct filter *filter, struct filter **filters)
static void
merge_nconf(struct network_conf *dest, struct network_conf *src)
{
return;
assert(strcmp(dest->ifname, src->ifname) == 0);
#define MERGE(field) \
do { \
if(src->field) \
dest->field = src->field; \
} while(0)
MERGE(hello_interval);
MERGE(update_interval);
MERGE(cost);
MERGE(wired);
MERGE(split_horizon);
MERGE(lq);
#undef MERGE
}
static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment