]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Check we manage the protocol before handling it.
authorRoy Marples <roy@marples.name>
Mon, 2 Mar 2015 20:08:10 +0000 (20:08 +0000)
committerRoy Marples <roy@marples.name>
Mon, 2 Mar 2015 20:08:10 +0000 (20:08 +0000)
ipv4.c
ipv6.c

diff --git a/ipv4.c b/ipv4.c
index d1a223e420c7d589acffd38d5151e73dc2c23662..21538248401fccb7e2d45e4f3c28f1f28d0643a1 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -366,6 +366,9 @@ ipv4_handlert(struct dhcpcd_ctx *ctx, int cmd, struct rt *rt)
 {
        struct rt *f;
 
+       if (ctx->ipv4_kroutes == NULL)
+               return 0;
+
        f = ipv4_findrt(ctx, rt, 1);
        switch (cmd) {
        case RTM_ADD:
diff --git a/ipv6.c b/ipv6.c
index 4503ffed0224c36b847c86527d31c74f3ff8db8a..8f1f02161ed0ee44934d4578b93ddc9dadd0539f 100644 (file)
--- a/ipv6.c
+++ b/ipv6.c
@@ -1767,6 +1767,9 @@ ipv6_handlert(struct dhcpcd_ctx *ctx, int cmd, struct rt6 *rt)
 {
        struct rt6 *f;
 
+       if (ctx->ipv6 == NULL)
+               return 0;
+
        f = ipv6_findrt(ctx, rt, 1);
        switch(cmd) {
        case RTM_ADD: