summaryrefslogtreecommitdiff
path: root/src/shared/firewall-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-05 19:30:31 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:31 +0200
commit08ce521fb2546921f2642bef067d2cc02158b121 (patch)
treec7489e6a4cfa9946425941ea72fee0536e71787c /src/shared/firewall-util.c
parent76adb5b8b57ce40947fd00f7b33ea7b1d1e1e738 (diff)
shared: add a temporary work-around for kernel header inclusion fuck-up
See: #2864
Diffstat (limited to 'src/shared/firewall-util.c')
-rw-r--r--src/shared/firewall-util.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/shared/firewall-util.c b/src/shared/firewall-util.c
index 0d3da2e6d2..ade2de7727 100644
--- a/src/shared/firewall-util.c
+++ b/src/shared/firewall-util.c
@@ -17,14 +17,24 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#warning "Temporary work-around for broken glibc vs. linux kernel header definitions"
+#warning "This really should be removed sooner rather than later, when this is fixed upstream"
+#define _NET_IF_H 1
+
#include <alloca.h>
#include <arpa/inet.h>
#include <endian.h>
#include <errno.h>
-#include <net/if.h>
#include <stddef.h>
#include <string.h>
#include <sys/socket.h>
+#include <net/if.h>
+#include <linux/if.h>
+#ifndef IFNAMSIZ
+#undef _NET_IF_H
+/* Let's make sure to include this one, too, if IFNAMSIZ isn't defined yet, as it is for kernels <= 4.2 */
+#include <net/if.h>
+#endif
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter/nf_nat.h>
#include <linux/netfilter/xt_addrtype.h>