[PATCH 1/2 nft] src: use OSF_GENRE_SIZE instead of IFNAMSIZ in osf.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As no "genre" in pf.os exceed 16 bytes of length, we reduce OSF_GENRE_SIZE
parameter to 16 bytes and use it instead of IFNAMSIZ.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@xxxxxxxxxx>
---
 include/osf.h | 2 ++
 src/osf.c     | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/osf.h b/include/osf.h
index 715b04e..d4d0c19 100644
--- a/include/osf.h
+++ b/include/osf.h
@@ -1,6 +1,8 @@
 #ifndef NFTABLES_OSF_H
 #define NFTABLES_OSF_H
 
+#define OSF_GENRE_SIZE	16
+
 struct expr *osf_expr_alloc(const struct location *loc);
 
 #endif /* NFTABLES_OSF_H */
diff --git a/src/osf.c b/src/osf.c
index f07a725..e7aae89 100644
--- a/src/osf.c
+++ b/src/osf.c
@@ -4,8 +4,6 @@
 #include <string.h>
 #include <osf.h>
 
-#include <net/if.h>
-
 static void osf_expr_print(const struct expr *expr, struct output_ctx *octx)
 {
 	nft_print(octx, "osf name");
@@ -24,7 +22,7 @@ static const struct expr_ops osf_expr_ops = {
 
 struct expr *osf_expr_alloc(const struct location *loc)
 {
-	unsigned int len = IFNAMSIZ * BITS_PER_BYTE;
+	unsigned int len = OSF_GENRE_SIZE * BITS_PER_BYTE;
 	const struct datatype *type = &string_type;
 	struct expr *expr;
 
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux