]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't do ipv6 routes if ipv6 is disabled.
authorRoy Marples <roy@marples.name>
Wed, 6 Apr 2016 20:53:54 +0000 (20:53 +0000)
committerRoy Marples <roy@marples.name>
Wed, 6 Apr 2016 20:53:54 +0000 (20:53 +0000)
ipv6.c

diff --git a/ipv6.c b/ipv6.c
index f7451e40b48924f033ce68c53ac44fc561379920..d5755342ae85ccc78c5abfa76a8be033a9046643 100644 (file)
--- a/ipv6.c
+++ b/ipv6.c
@@ -1472,8 +1472,10 @@ ipv6_freedrop(struct interface *ifp, int drop)
 
        ipv6_freedrop_addrs(&state->addrs, drop ? 2 : 0, NULL);
        if (drop) {
-               if_initrt6(ifp);
-               ipv6_buildroutes(ifp->ctx);
+               if (ifp->ctx->ipv6 != NULL) {
+                       if_initrt6(ifp);
+                       ipv6_buildroutes(ifp->ctx);
+               }
        } else {
                /* Because we need to cache the addresses we don't control,
                 * we only free the state on when NOT dropping addresses. */