From: Roy Marples Date: Fri, 16 Jan 2015 23:39:03 +0000 (+0000) Subject: Let packet filters name themselves to avoid confusion. X-Git-Tag: v6.7.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6091c732b0f29f0a9829b30d92bf27f323af3ab5;p=thirdparty%2Fdhcpcd.git Let packet filters name themselves to avoid confusion. --- diff --git a/dhcp.c b/dhcp.c index 8fdbc357..91a9ce9d 100644 --- a/dhcp.c +++ b/dhcp.c @@ -2877,8 +2877,7 @@ dhcp_open(struct interface *ifp) state->raw_fd = if_openrawsocket(ifp, ETHERTYPE_IP); if (state->raw_fd == -1) { if (errno == ENOENT) { - syslog(LOG_ERR, - "Packet Filter missing from kernel"); + syslog(LOG_ERR, "%s not found", if_pfname); /* May as well disable IPv4 entirely at * this point as we really need it. */ ifp->options->options &= ~DHCPCD_IPV4; diff --git a/if-bsd.c b/if-bsd.c index 40ca85cc..baa4bd80 100644 --- a/if-bsd.c +++ b/if-bsd.c @@ -260,6 +260,8 @@ if_vimaster(const char *ifname) } #ifdef INET +const char *if_pfname = "Berkley Packet Filter"; + int if_openrawsocket(struct interface *ifp, int protocol) { diff --git a/if-linux.c b/if-linux.c index 590f241a..69f5432e 100644 --- a/if-linux.c +++ b/if-linux.c @@ -1062,6 +1062,8 @@ struct nlmr }; #ifdef INET +const char *if_pfname = "Packet Socket"; + int if_openrawsocket(struct interface *ifp, int protocol) { diff --git a/if.h b/if.h index 161654ac..98a07586 100644 --- a/if.h +++ b/if.h @@ -103,6 +103,7 @@ int if_openlinksocket(void); int if_managelink(struct dhcpcd_ctx *); #ifdef INET +extern const char *if_pfname; int if_openrawsocket(struct interface *, int); ssize_t if_sendrawpacket(const struct interface *, int, const void *, size_t);