summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-03-05 00:28:36 +0000
committerRoy Marples <roy@marples.name>2019-03-05 00:28:36 +0000
commit59823748fea1b64f0a34125fd5a0591a34029600 (patch)
tree25a23bc0321843a3138530c57418bb433a55226f /src/ipv6.c
parentf1ea704ea8b1fec41299b04b40fb6ee17151299c (diff)
downloaddhcpcd-59823748fea1b64f0a34125fd5a0591a34029600.tar.xz
route: Remove kroutes and make froutes optional
This is an attempt to reduce the memory dhcpcd uses. By removing kroutes and froutes from global context. kroutes are generated at the start of rt_build and freed at the end.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index ee626330..34c302fe 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -1604,7 +1604,6 @@ ipv6_startstatic(struct interface *ifp)
ia->prefix_pltime = ND6_INFINITE_LIFETIME;
ia->dadcallback = ipv6_staticdadcallback;
ipv6_addaddr(ia, NULL);
- if_initrt(ifp->ctx, AF_INET6);
rt_build(ifp->ctx, AF_INET6);
if (run_script)
script_runreason(ifp, "STATIC6");
@@ -1646,8 +1645,6 @@ ipv6_start(struct interface *ifp)
ipv6_regentempifid(ifp);
}
- /* Load existing routes */
- if_initrt(ifp->ctx, AF_INET6);
return 0;
}
@@ -1671,10 +1668,8 @@ ipv6_freedrop(struct interface *ifp, int drop)
ipv6_freedrop_addrs(&state->addrs, drop ? 2 : 0, NULL);
if (drop) {
- if (ifp->ctx->ra_routers != NULL) {
- if_initrt(ifp->ctx, AF_INET6);
+ if (ifp->ctx->ra_routers != NULL)
rt_build(ifp->ctx, AF_INET6);
- }
} else {
/* Because we need to cache the addresses we don't control,
* we only free the state on when NOT dropping addresses. */