Signed-off-by: Steven Barth <steven@midlink.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43707
3c298f89-4303-0410-b956-
a3cf2f4a3e73
include $(TOPDIR)/rules.mk
PKG_NAME:=nftables
include $(TOPDIR)/rules.mk
PKG_NAME:=nftables
-PKG_VERSION:=0.3+2014-10-21
+PKG_VERSION:=0.3+2014-12-11
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://git.netfilter.org/nftables
PKG_SOURCE_PROTO:=git
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://git.netfilter.org/nftables
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=17b495957b29e699f59874d1ceca9535921b1a79
+PKG_SOURCE_VERSION:=81cffc1ee5098809167085bc997297a61d7476bd
PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
PKG_LICENSE:=GPL-2.0
--without-libgmp \
--without-cli \
--without-libgmp \
--without-cli \
+TARGET_CFLAGS += -D_GNU_SOURCE
+
define Package/nftables
SECTION:=net
CATEGORY:=Network
define Package/nftables
SECTION:=net
CATEGORY:=Network
--- a/configure.ac
+++ b/configure.ac
--- a/configure.ac
+++ b/configure.ac
-@@ -68,8 +68,18 @@ AC_CHECK_LIB([mnl], [mnl_socket_open], ,
- AC_CHECK_LIB([nftnl], [nft_rule_alloc], ,
- AC_MSG_ERROR([No suitable version of libnftnl found]))
+@@ -72,8 +72,19 @@ AM_CONDITIONAL([BUILD_PDF], [test "$DBLA
+ PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
+ PKG_CHECK_MODULES([LIBNFTNL], [libnftnl >= 1.0.2])
-AC_CHECK_LIB([gmp], [__gmpz_init], ,
- AC_MSG_ERROR([No suitable version of libgmp found]))
-AC_CHECK_LIB([gmp], [__gmpz_init], ,
- AC_MSG_ERROR([No suitable version of libgmp found]))
+ [with_libgmp=yes])
+AS_IF([test "x$with_libgmp" != xno], [
+AC_CHECK_LIB([gmp],[__gmpz_init], , AC_MSG_ERROR([No suitable version of libgmp found]))
+ [with_libgmp=yes])
+AS_IF([test "x$with_libgmp" != xno], [
+AC_CHECK_LIB([gmp],[__gmpz_init], , AC_MSG_ERROR([No suitable version of libgmp found]))
++AC_DEFINE([HAVE_LIBGMP], [1], [])
++AM_CONDITIONAL([BUILD_MINIGMP], [test "x$with_libgmp" == xno])
+
+
+AS_IF([test "x$with_libgmp" != xyes -a "x$CONFIG_DEBUG" = xy], [
+
+
+AS_IF([test "x$with_libgmp" != xyes -a "x$CONFIG_DEBUG" = xy], [
#endif
#define __fmtstring(x, y) __attribute__((format(printf, x, y)))
#endif
#define __fmtstring(x, y) __attribute__((format(printf, x, y)))
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -31,3 +31,8 @@ nft-extra-clean-files += parser.c parser
-
- nft-obj += scanner.o
- nft-extra-clean-files += scanner.c scanner.h
-+
-+ifneq (@with_libgmp@,yes)
-+nft-obj += mini-gmp.o
-+nft-obj += mini-gmp-printf.o
-+endif
--- a/src/datatype.c
+++ b/src/datatype.c
--- a/src/datatype.c
+++ b/src/datatype.c
-@@ -267,11 +267,9 @@ static struct error_record *integer_type
+@@ -275,11 +275,9 @@ static struct error_record *integer_type
struct expr **res)
{
mpz_t v;
struct expr **res)
{
mpz_t v;
- (int)strlen(sym->identifier) != len) {
+ if (mpz_set_str(v, sym->identifier, 0)) {
mpz_clear(v);
- (int)strlen(sym->identifier) != len) {
+ if (mpz_set_str(v, sym->identifier, 0)) {
mpz_clear(v);
- if (sym->dtype != &integer_type)
- return NULL;
+ return error(&sym->location, "Could not parse %s",
+ sym->dtype->desc);
--- a/src/erec.c
+++ b/src/erec.c
--- a/src/erec.c
+++ b/src/erec.c
-@@ -43,6 +43,7 @@ static void erec_destroy(struct error_re
+@@ -44,6 +44,7 @@ static void erec_destroy(struct error_re
struct error_record *erec_vcreate(enum error_record_types type,
const struct location *loc,
const char *fmt, va_list ap)
struct error_record *erec_vcreate(enum error_record_types type,
const struct location *loc,
const char *fmt, va_list ap)
-@@ -54,10 +55,11 @@ struct error_record *erec_vcreate(enum e
+@@ -55,10 +56,11 @@ struct error_record *erec_vcreate(enum e
erec->num_locations = 0;
erec_add_location(erec, loc);
erec->num_locations = 0;
erec_add_location(erec, loc);
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -48,4 +48,8 @@ if BUILD_CLI
+ nft_SOURCES += cli.c
+ endif
+
++if BUILD_MINIGMP
++nft_SOURCES += mini-gmp.c mini-gmp-printf.c
++endif
++
+ nft_LDADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS}
--- /dev/null
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -3,7 +3,7 @@ sbin_PROGRAMS = nft
+ CLEANFILES = scanner.c parser_bison.c
+
+ AM_CPPFLAGS = -I$(top_srcdir)/include
+-AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\"" -DDEBUG \
++AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\"" \
+ ${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS}
+
+ AM_CFLAGS = -Wall \
+++ /dev/null
---- a/Makefile.defs.in
-+++ b/Makefile.defs.in
-@@ -24,6 +24,7 @@ LDFLAGS += @LIBS@
-
- CPPFLAGS += @CPPFLAGS@
-
-+CFLAGS :=
- CFLAGS += @CFLAGS@ @DEFS@
- CFLAGS += -DDEFAULT_INCLUDE_PATH="\"$(confdir)\""
- CFLAGS += -include config.h