Skip to contentSkip to conversation

nftables 1.0.2 building issues

PATCH Francesco Colista 2 participants 2 messages Mar 4, 2022 netfilter

lore
Share & tools
lore
#0 lore raw

Hello.

I'm the maintainer of nftables in Alpine Linux (www.alpinelinux.org).

With the latest release (1.0.2), has been added an "examples" dir [1].
The building phase fails because it search in the standard library nftables/libnftables.h which does not exists.

Downstream we fixed this issue in this way: https://git.alpinelinux.org/aports/commit/?id=d15572ba655e7c48622fa87aca1c1a29f12b883b

You can find the patch attached...even though I'm sure that there's a more elegant solution to this issue :)

Thanks for considering.

[1] https://git.netfilter.org/nftables/commit/?id=5b364657a35f4e4cd5d220ba2a45303d729c8eca

.: Francesco Colista

From cad646638a35cc60ed7277c506917294fe03f2d4 Mon Sep 17 00:00:00 2001
From: Francesco Colista <[email protected]>
Date: Fri, 4 Mar 2022 16:38:47 +0100
Subject: [PATCH] examples: fix include path

When building the examples dir files, build fails
<nftables/libnftables.h> is not yet in place.

This patch allows to point directly to the nftables/libnftables.h within the source tree

---
 examples/nft-buffer.c    | 2 +-
 examples/nft-json-file.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
examples/nft-buffer.c +1 -1
index 1c4b1e04..5bd84b34 100644
@@ -1,6 +1,6 @@
 /* gcc nft-buffer.c -o nft-buffer -lnftables */
 #include <stdlib.h>
-#include <nftables/libnftables.h>
+#include "../include/nftables/libnftables.h"
 
 const char ruleset[] =
 	"flush ruleset;"
examples/nft-json-file.c +1 -1
index 0c832f22..e3c3568e 100644
@@ -1,6 +1,6 @@
 /* gcc nft-json-file.c -o nft-json-file -lnftables */
 #include <stdlib.h>
-#include <nftables/libnftables.h>
+#include "../include/nftables/libnftables.h"
 
 int main(void)
 {
Signature · 1 line
2.35.1
#1 lore raw
Quoted 7 lines · Francesco Colista

I'm the maintainer of nftables in Alpine Linux (www.alpinelinux.org).

With the latest release (1.0.2), has been added an "examples" dir [1].
The building phase fails because it search in the standard library nftables/libnftables.h which does not exists.

Downstream we fixed this issue in this way: https://git.alpinelinux.org/aports/commit/?id=d15572ba655e7c48622fa87aca1c1a29f12b883b

https://lore.kernel.org/netfilter-devel/[email protected]/T/#m140c8076a73c701fd0fbbd81d9cce91221677fd9
http://git.netfilter.org/nftables/commit/?id=18a08fb7f0443f8bde83393bd6f69e23a04246b3