From: Roy Marples Date: Mon, 2 Mar 2015 20:08:10 +0000 (+0000) Subject: Check we manage the protocol before handling it. X-Git-Tag: v6.8.0~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f6de1802f7b353040c59007d82645efce4b6c0a;p=thirdparty%2Fdhcpcd.git Check we manage the protocol before handling it. --- diff --git a/ipv4.c b/ipv4.c index d1a223e4..21538248 100644 --- 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 4503ffed..8f1f0216 100644 --- 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: