summaryrefslogtreecommitdiffstats
path: root/nest/rt-dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/rt-dev.c')
-rw-r--r--nest/rt-dev.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/nest/rt-dev.c b/nest/rt-dev.c
index 239bd26..497ee80 100644
--- a/nest/rt-dev.c
+++ b/nest/rt-dev.c
@@ -92,9 +92,24 @@ dev_reconfigure(struct proto *p, struct proto_config *new)
return iface_patts_equal(&o->iface_list, &n->iface_list, NULL);
}
+static void
+dev_copy_config(struct proto_config *dest, struct proto_config *src)
+{
+ struct rt_dev_config *d = (struct rt_dev_config *) dest;
+ struct rt_dev_config *s = (struct rt_dev_config *) src;
+
+ /*
+ * We copy iface_list as ifaces can be shared by more direct protocols.
+ * Copy suffices to be is shallow, because new nodes can be added, but
+ * old nodes cannot be modified (although they contain internal lists).
+ */
+ cfg_copy_list(&d->iface_list, &s->iface_list, sizeof(struct iface_patt));
+}
+
struct protocol proto_device = {
name: "Direct",
template: "direct%d",
init: dev_init,
- reconfigure: dev_reconfigure
+ reconfigure: dev_reconfigure,
+ copy_config: dev_copy_config
};