summaryrefslogtreecommitdiff
path: root/main/openvpn/src/openvpn/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/openvpn/src/openvpn/route.c')
-rw-r--r--main/openvpn/src/openvpn/route.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/openvpn/src/openvpn/route.c b/main/openvpn/src/openvpn/route.c
index 545a929b..e4224e19 100644
--- a/main/openvpn/src/openvpn/route.c
+++ b/main/openvpn/src/openvpn/route.c
@@ -109,6 +109,13 @@ new_route_ipv6_option_list (struct gc_arena *a)
return ret;
}
+/*
+ * NOTE: structs are cloned/copied shallow by design.
+ * The routes list from src will stay intact since it is allocated using
+ * the options->gc. The cloned/copied lists will share this common tail
+ * to avoid copying the data around between pulls. Pulled routes use
+ * the c2->gc so they get freed immediately after a reconnect.
+ */
struct route_option_list *
clone_route_option_list (const struct route_option_list *src, struct gc_arena *a)
{