Commit 38575f7a authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement merge_nconf.

This had never been implemented, we were silently ignoring duplicate
configuration lines.
parent 6e9fbfe1
...@@ -24,6 +24,7 @@ THE SOFTWARE. ...@@ -24,6 +24,7 @@ THE SOFTWARE.
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <sys/time.h> #include <sys/time.h>
#include <assert.h>
#ifdef __linux #ifdef __linux
/* Defining it rather than including <linux/rtnetlink.h> because this /* Defining it rather than including <linux/rtnetlink.h> because this
...@@ -500,7 +501,22 @@ add_filter(struct filter *filter, struct filter **filters) ...@@ -500,7 +501,22 @@ add_filter(struct filter *filter, struct filter **filters)
static void static void
merge_nconf(struct network_conf *dest, struct network_conf *src) 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 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