From: Roy Marples Date: Fri, 16 Jan 2015 23:11:39 +0000 (+0000) Subject: If we cannot open the kernel Packet Filter, give a better error message X-Git-Tag: v6.7.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31f26dd9b38412a332c0e2c1824e2531b2c8b35e;p=thirdparty%2Fdhcpcd.git If we cannot open the kernel Packet Filter, give a better error message and disable IPv4 configuration. --- diff --git a/dhcp.c b/dhcp.c index 31d018ff..8fdbc357 100644 --- a/dhcp.c +++ b/dhcp.c @@ -2876,7 +2876,15 @@ dhcp_open(struct interface *ifp) if (state->raw_fd == -1) { state->raw_fd = if_openrawsocket(ifp, ETHERTYPE_IP); if (state->raw_fd == -1) { - syslog(LOG_ERR, "%s: %s: %m", __func__, ifp->name); + if (errno == ENOENT) { + syslog(LOG_ERR, + "Packet Filter missing from kernel"); + /* May as well disable IPv4 entirely at + * this point as we really need it. */ + ifp->options->options &= ~DHCPCD_IPV4; + } else + syslog(LOG_ERR, "%s: %s: %m", + __func__, ifp->name); return -1; } eloop_event_add(ifp->ctx->eloop,