]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If we cannot open the kernel Packet Filter, give a better error message
authorRoy Marples <roy@marples.name>
Fri, 16 Jan 2015 23:11:39 +0000 (23:11 +0000)
committerRoy Marples <roy@marples.name>
Fri, 16 Jan 2015 23:11:39 +0000 (23:11 +0000)
and disable IPv4 configuration.

dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 31d018ff920a404a7b211541fca872346d7ea6ce..8fdbc3574b92cdc9ef2c5613d8bbdf624bb9ce63 100644 (file)
--- 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,