netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ANNOUNCE] ipset 6.16.1 released
@ 2012-11-27 14:16 Jozsef Kadlecsik
  2013-01-09 13:48 ` Andreas Herz
  0 siblings, 1 reply; 10+ messages in thread
From: Jozsef Kadlecsik @ 2012-11-27 14:16 UTC (permalink / raw)
  To: netfilter, netfilter-devel

Hi,

I'm happy to announce ipset 6.16.1. The most important part is the patch 
from Florian Westphal, which fixes netiface set name overflow in the 
kernel. The RCU handling of the automating increase of the maximal sets 
feature introduced in 6.15 is also fixed.

Userspace changes:
  - Remove all modules before testing resize 
  - build: support for Linux 3.7 UAPI (Jan Engelhardt) 

Kernel part changes:
  - Add ipset package version to external module description 
  - Backport RCU handling up to 2.6.32.x 
  - Netlink pid is renamed to portid in kernel 3.7.0 
  - Fix RCU handling when the number of maximal sets are increased
  - netfilter: ipset: fix netiface set name overflow (Florian Westphal) 

You can download the source code of ipset from:
        http://ipset.netfilter.org
        ftp://ftp.netfilter.org/pub/ipset/
        git://git.netfilter.org/ipset.git

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] ipset 6.16.1 released
  2012-11-27 14:16 [ANNOUNCE] ipset 6.16.1 released Jozsef Kadlecsik
@ 2013-01-09 13:48 ` Andreas Herz
  2013-01-09 22:44   ` Jozsef Kadlecsik
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Herz @ 2013-01-09 13:48 UTC (permalink / raw)
  To: netfilter

On 27/11/12 at 15:16, Jozsef Kadlecsik wrote:
> I'm happy to announce ipset 6.16.1. The most important part is the patch 
> from Florian Westphal, which fixes netiface set name overflow in the 
> kernel. The RCU handling of the automating increase of the maximal sets 
> feature introduced in 6.15 is also fixed.

It works fine on new machines, but i got this compiler error with some
older system:

In file included from
/usr/src/redhat/BUILD/ipset-6.16.1/kernel/net/netfilter/ipset/ip_set_hash_ip.c:115:

/usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:
In function `hash_ip4_add':

/usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:448:
sorry, unimplemented: inlining failed in call to 'hash_ip4_data_next':
function body not available

/usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:489:
sorry, unimplemented: called from here

make[3]: ***
[/usr/src/redhat/BUILD/ipset-6.16.1/kernel/net/netfilter/ipset/ip_set_hash_ip.o]
Error 1

gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)

Yes it's old and i know gcc update may fix this. But still, is there
another way to fix it? removing the "inline" in front of
type_pf_data_next resolves it somehow as it's compiling through and
seems to work just fine. It "just" results in this warning:

/usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:448:
warning: 'hash_ip4_data_next' declared inline after being called

/usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:448:
warning: previous declaration of 'hash_ip4_data_next' was here

thanks so far.

-- 
Andreas Herz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] ipset 6.16.1 released
  2013-01-09 13:48 ` Andreas Herz
@ 2013-01-09 22:44   ` Jozsef Kadlecsik
  2013-01-09 23:12     ` Jan Engelhardt
  0 siblings, 1 reply; 10+ messages in thread
From: Jozsef Kadlecsik @ 2013-01-09 22:44 UTC (permalink / raw)
  To: Andreas Herz; +Cc: netfilter

Hi Andreas,

On Wed, 9 Jan 2013, Andreas Herz wrote:

> On 27/11/12 at 15:16, Jozsef Kadlecsik wrote:
> > I'm happy to announce ipset 6.16.1. The most important part is the patch 
> > from Florian Westphal, which fixes netiface set name overflow in the 
> > kernel. The RCU handling of the automating increase of the maximal sets 
> > feature introduced in 6.15 is also fixed.
> 
> It works fine on new machines, but i got this compiler error with some
> older system:
> 
> In file included from
> /usr/src/redhat/BUILD/ipset-6.16.1/kernel/net/netfilter/ipset/ip_set_hash_ip.c:115:
> 
> /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:
> In function `hash_ip4_add':
> 
> /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:448:
> sorry, unimplemented: inlining failed in call to 'hash_ip4_data_next':
> function body not available
> 
> /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:489:
> sorry, unimplemented: called from here
> 
> make[3]: ***
> [/usr/src/redhat/BUILD/ipset-6.16.1/kernel/net/netfilter/ipset/ip_set_hash_ip.o]
> Error 1
> 
> gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)
> 
> Yes it's old and i know gcc update may fix this. But still, is there
> another way to fix it? removing the "inline" in front of
> type_pf_data_next resolves it somehow as it's compiling through and
> seems to work just fine. It "just" results in this warning:
> 
> /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:448:
> warning: 'hash_ip4_data_next' declared inline after being called
> 
> /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:448:
> warning: previous declaration of 'hash_ip4_data_next' was here

Does the next patch solve the compilation issue with your old gcc version?

diff --git a/Makefile.am b/Makefile.am
index 9e2d59b..a912b38 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,13 +15,19 @@ else
 IP_SET_MAX=$(MAXSETS)
 endif
 
+if INLINE_IN_PROTOTYPE
+INLINE=inline
+else
+INLINE=
+endif
+
 SUBDIRS		= include/libipset lib src
 
 modules_sparse:
 if WITH_KMOD
 	${MAKE} -C $(KBUILD_OUTPUT) M=$$PWD/kernel/net/netfilter \
 			V=$V C=2 CF=-D__CHECK_ENDIAN__ \
-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)-DINLINE=$(INLINE)" \
 			IP_SET_MAX=$(IP_SET_MAX) KDIR=$$PWD/kernel modules
 else
 	@echo Skipping kernel modules due to --with-kmod=no
@@ -30,7 +36,7 @@ endif
 modules:
 if WITH_KMOD
 	${MAKE} -C $(KBUILD_OUTPUT) M=$$PWD/kernel/net/netfilter V=$V \
-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION) -DINLINE=$(INLINE)" \
 			IP_SET_MAX=$(IP_SET_MAX) KDIR=$$PWD/kernel modules
 else
 	@echo Skipping kernel modules due to --with-kmod=no
diff --git a/configure.ac b/configure.ac
index 4c9fcad..60443c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,6 +206,26 @@ AX_CFLAGS_GCC_OPTION(-Wunused)
 AX_CFLAGS_GCC_OPTION(-Wvla)
 AX_CFLAGS_GCC_OPTION(-Wwrite-strings)
 fi
+
+AC_MSG_CHECKING([whether compiler supports inline in prototype])
+	AC_TRY_RUN([ /* inline check */
+static inline int foo(void);
+static inline int foo(void) { return 1; }
+main() {
+	int a = foo();
+	exit(0);
+}
+],
+[ AC_MSG_RESULT(yes)
+  AC_DEFINE(INLINE_IN_PROTOTYPE, [1], [Inline in prototype supported.])
+  inline_in_prototype=yes],
+[ AC_MSG_RESULT(no)
+  inline_in_prototype=no],
+[ AC_MSG_RESULT(not when cross-compiling)
+  inline_in_prototype=no]
+)
+AM_CONDITIONAL(INLINE_IN_PROTOTYPE, test "$inline_in_prototype" == "yes")
+
 dnl Checks for library functions.
 
 dnl Generate output
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_ahash.h b/kernel/include/linux/netfilter/ipset/ip_set_ahash.h
index df6eb04..3696a87 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/kernel/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -440,7 +440,7 @@ retry:
 	return 0;
 }
 
-static inline void
+static INLINE void
 type_pf_data_next(struct ip_set_hash *h, const struct type_pf_elem *d);
 
 /* Add an element to a hash and update the internal counters when succeeded,
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_ip.c b/kernel/net/netfilter/ipset/ip_set_hash_ip.c
index 5c0b785..df595e7 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_ip.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_ip.c
@@ -114,7 +114,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ip4_data_next(struct ip_set_hash *h, const struct hash_ip4_elem *d)
 {
 	h->next.ip = d->ip;
@@ -298,7 +298,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ip6_data_next(struct ip_set_hash *h, const struct hash_ip6_elem *d)
 {
 }
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_ipport.c b/kernel/net/netfilter/ipset/ip_set_hash_ipport.c
index 6283351..e8b9eaf 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_ipport.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_ipport.c
@@ -129,7 +129,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipport4_data_next(struct ip_set_hash *h,
 		       const struct hash_ipport4_elem *d)
 {
@@ -348,7 +348,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipport6_data_next(struct ip_set_hash *h,
 		       const struct hash_ipport6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_ipportip.c b/kernel/net/netfilter/ipset/ip_set_hash_ipportip.c
index 6a21271..7ceb813 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_ipportip.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_ipportip.c
@@ -132,7 +132,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipportip4_data_next(struct ip_set_hash *h,
 			 const struct hash_ipportip4_elem *d)
 {
@@ -361,7 +361,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipportip6_data_next(struct ip_set_hash *h,
 			 const struct hash_ipportip6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c b/kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c
index 2d5cd4e..8473a01 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c
@@ -174,7 +174,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipportnet4_data_next(struct ip_set_hash *h,
 			  const struct hash_ipportnet4_elem *d)
 {
@@ -493,7 +493,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipportnet6_data_next(struct ip_set_hash *h,
 			  const struct hash_ipportnet6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_net.c b/kernel/net/netfilter/ipset/ip_set_hash_net.c
index 29e94b9..309e7a0 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_net.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_net.c
@@ -152,7 +152,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_net4_data_next(struct ip_set_hash *h,
 		    const struct hash_net4_elem *d)
 {
@@ -382,7 +382,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_net6_data_next(struct ip_set_hash *h,
 		    const struct hash_net6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_netiface.c b/kernel/net/netfilter/ipset/ip_set_hash_netiface.c
index 45a1014..3997f51 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_netiface.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_netiface.c
@@ -273,7 +273,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_netiface4_data_next(struct ip_set_hash *h,
 			 const struct hash_netiface4_elem *d)
 {
@@ -576,7 +576,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_netiface6_data_next(struct ip_set_hash *h,
 			 const struct hash_netiface6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_netport.c b/kernel/net/netfilter/ipset/ip_set_hash_netport.c
index 7ef700d..c1ff1de 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_netport.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_netport.c
@@ -172,7 +172,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_netport4_data_next(struct ip_set_hash *h,
 			const struct hash_netport4_elem *d)
 {
@@ -452,7 +452,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_netport6_data_next(struct ip_set_hash *h,
 			const struct hash_netport6_elem *d)
 {

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] ipset 6.16.1 released
  2013-01-09 22:44   ` Jozsef Kadlecsik
@ 2013-01-09 23:12     ` Jan Engelhardt
  2013-01-10  9:06       ` Jozsef Kadlecsik
  2013-01-10  9:07       ` Andreas Herz
  0 siblings, 2 replies; 10+ messages in thread
From: Jan Engelhardt @ 2013-01-09 23:12 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: Andreas Herz, netfilter


On Wednesday 2013-01-09 23:44, Jozsef Kadlecsik wrote:
>-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
>+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)-DINLINE=$(INLINE)" \

You seem to be missing a space before -DINL

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] ipset 6.16.1 released
  2013-01-09 23:12     ` Jan Engelhardt
@ 2013-01-10  9:06       ` Jozsef Kadlecsik
  2013-01-10  9:07       ` Andreas Herz
  1 sibling, 0 replies; 10+ messages in thread
From: Jozsef Kadlecsik @ 2013-01-10  9:06 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Andreas Herz, netfilter

On Thu, 10 Jan 2013, Jan Engelhardt wrote:

> 
> On Wednesday 2013-01-09 23:44, Jozsef Kadlecsik wrote:
> >-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
> >+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)-DINLINE=$(INLINE)" \
> 
> You seem to be missing a space before -DINL

You're right, thanks! Fortunately that's in the sparse mode compiling 
part, so the patch still can be give a go for testing.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] ipset 6.16.1 released
  2013-01-09 23:12     ` Jan Engelhardt
  2013-01-10  9:06       ` Jozsef Kadlecsik
@ 2013-01-10  9:07       ` Andreas Herz
  2013-01-10  9:16         ` Jozsef Kadlecsik
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Herz @ 2013-01-10  9:07 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Jozsef Kadlecsik, netfilter

On 10/01/13 at 00:12, Jan Engelhardt wrote:
> 
> On Wednesday 2013-01-09 23:44, Jozsef Kadlecsik wrote:
> >-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
> >+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)-DINLINE=$(INLINE)" \
> 
> You seem to be missing a space before -DINL

I also changed this in the patch, but still:

/usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:
In function `hash_ip4_add':
/usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:444:
sorry, unimplemented: inlining failed in call to 'hash_ip4_data_next':
function body not available
/usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:485:
sorry, unimplemented: called from here

Don't bother too much, as i can build it on another machine, but i'm
curious why it won't work and how it should be fixed.

thanks

-- 
Andreas Herz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] ipset 6.16.1 released
  2013-01-10  9:07       ` Andreas Herz
@ 2013-01-10  9:16         ` Jozsef Kadlecsik
  2013-01-10  9:26           ` Andreas Herz
  0 siblings, 1 reply; 10+ messages in thread
From: Jozsef Kadlecsik @ 2013-01-10  9:16 UTC (permalink / raw)
  To: Andreas Herz; +Cc: Jan Engelhardt, netfilter

On Thu, 10 Jan 2013, Andreas Herz wrote:

> On 10/01/13 at 00:12, Jan Engelhardt wrote:
> > 
> > On Wednesday 2013-01-09 23:44, Jozsef Kadlecsik wrote:
> > >-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
> > >+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)-DINLINE=$(INLINE)" \
> > 
> > You seem to be missing a space before -DINL
> 
> I also changed this in the patch, but still:
> 
> /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:
> In function `hash_ip4_add':
> /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:444:
> sorry, unimplemented: inlining failed in call to 'hash_ip4_data_next':
> function body not available
> /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:485:
> sorry, unimplemented: called from here

So in the generated config.h you can find the next, right?

/* Inline in prototype supported. */
#define INLINE_IN_PROTOTYPE 1

> Don't bother too much, as i can build it on another machine, but i'm
> curious why it won't work and how it should be fixed.

The old gcc does not accept the "inline" keyword in the function 
prototype. The patch attempted to detect it and depending on the result, 
the keyword is used or not.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] ipset 6.16.1 released
  2013-01-10  9:16         ` Jozsef Kadlecsik
@ 2013-01-10  9:26           ` Andreas Herz
  2013-01-10  9:46             ` Jozsef Kadlecsik
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Herz @ 2013-01-10  9:26 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: Jan Engelhardt, netfilter

On 10/01/13 at 10:16, Jozsef Kadlecsik wrote:
> On Thu, 10 Jan 2013, Andreas Herz wrote:
> 
> > On 10/01/13 at 00:12, Jan Engelhardt wrote:
> > > 
> > > On Wednesday 2013-01-09 23:44, Jozsef Kadlecsik wrote:
> > > >-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
> > > >+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)-DINLINE=$(INLINE)" \
> > > 
> > > You seem to be missing a space before -DINL
> > 
> > I also changed this in the patch, but still:
> > 
> > /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:
> > In function `hash_ip4_add':
> > /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:444:
> > sorry, unimplemented: inlining failed in call to 'hash_ip4_data_next':
> > function body not available
> > /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:485:
> > sorry, unimplemented: called from here
> 
> So in the generated config.h you can find the next, right?
> 
> /* Inline in prototype supported. */
> #define INLINE_IN_PROTOTYPE 1
> 

Yes this part is in the config.h

> > Don't bother too much, as i can build it on another machine, but i'm
> > curious why it won't work and how it should be fixed.
> 
> The old gcc does not accept the "inline" keyword in the function 
> prototype. The patch attempted to detect it and depending on the result, 
> the keyword is used or not.

Thanks for the explanation.

-- 
Andreas Herz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] ipset 6.16.1 released
  2013-01-10  9:26           ` Andreas Herz
@ 2013-01-10  9:46             ` Jozsef Kadlecsik
  2013-01-10  9:55               ` Andreas Herz
  0 siblings, 1 reply; 10+ messages in thread
From: Jozsef Kadlecsik @ 2013-01-10  9:46 UTC (permalink / raw)
  To: Andreas Herz; +Cc: Jan Engelhardt, netfilter

On Thu, 10 Jan 2013, Andreas Herz wrote:

> On 10/01/13 at 10:16, Jozsef Kadlecsik wrote:
> > On Thu, 10 Jan 2013, Andreas Herz wrote:
> > 
> > > On 10/01/13 at 00:12, Jan Engelhardt wrote:
> > > > 
> > > > On Wednesday 2013-01-09 23:44, Jozsef Kadlecsik wrote:
> > > > >-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
> > > > >+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)-DINLINE=$(INLINE)" \
> > > > 
> > > > You seem to be missing a space before -DINL
> > > 
> > > I also changed this in the patch, but still:
> > > 
> > > /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:
> > > In function `hash_ip4_add':
> > > /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:444:
> > > sorry, unimplemented: inlining failed in call to 'hash_ip4_data_next':
> > > function body not available
> > > /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:485:
> > > sorry, unimplemented: called from here
> > 
> > So in the generated config.h you can find the next, right?
> > 
> > /* Inline in prototype supported. */
> > #define INLINE_IN_PROTOTYPE 1
> 
> Yes this part is in the config.h

OK, let's give one more try. Could you remove the previous one and try the 
next one? (I don't have access to the given gcc version, so I cannot check 
it myself.)

diff --git a/Makefile.am b/Makefile.am
index 9e2d59b..7d4884e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,13 +15,19 @@ else
 IP_SET_MAX=$(MAXSETS)
 endif
 
+if INLINE_IN_PROTOTYPE
+INLINE=inline
+else
+INLINE=
+endif
+
 SUBDIRS		= include/libipset lib src
 
 modules_sparse:
 if WITH_KMOD
 	${MAKE} -C $(KBUILD_OUTPUT) M=$$PWD/kernel/net/netfilter \
 			V=$V C=2 CF=-D__CHECK_ENDIAN__ \
-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION) -DINLINE=$(INLINE)" \
 			IP_SET_MAX=$(IP_SET_MAX) KDIR=$$PWD/kernel modules
 else
 	@echo Skipping kernel modules due to --with-kmod=no
@@ -30,7 +36,7 @@ endif
 modules:
 if WITH_KMOD
 	${MAKE} -C $(KBUILD_OUTPUT) M=$$PWD/kernel/net/netfilter V=$V \
-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION) -DINLINE=$(INLINE)" \
 			IP_SET_MAX=$(IP_SET_MAX) KDIR=$$PWD/kernel modules
 else
 	@echo Skipping kernel modules due to --with-kmod=no
diff --git a/configure.ac b/configure.ac
index 4c9fcad..3182fc0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,6 +206,27 @@ AX_CFLAGS_GCC_OPTION(-Wunused)
 AX_CFLAGS_GCC_OPTION(-Wvla)
 AX_CFLAGS_GCC_OPTION(-Wwrite-strings)
 fi
+
+AC_MSG_CHECKING([whether compiler supports inline in prototype])
+	AC_TRY_RUN([ /* inline check */
+static inline int foo(void);
+static int bar(void) { return foo(); }
+static inline int foo(void) { return 1; }
+main() {
+	int a = bar();
+	exit(0);
+}
+],
+[ AC_MSG_RESULT(yes)
+  AC_DEFINE(INLINE_IN_PROTOTYPE, [1], [Inline in prototype supported.])
+  inline_in_prototype=yes],
+[ AC_MSG_RESULT(no)
+  inline_in_prototype=no],
+[ AC_MSG_RESULT(not when cross-compiling)
+  inline_in_prototype=no]
+)
+AM_CONDITIONAL(INLINE_IN_PROTOTYPE, test "$inline_in_prototype" == "yes")
+
 dnl Checks for library functions.
 
 dnl Generate output
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_ahash.h b/kernel/include/linux/netfilter/ipset/ip_set_ahash.h
index df6eb04..3696a87 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/kernel/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -440,7 +440,7 @@ retry:
 	return 0;
 }
 
-static inline void
+static INLINE void
 type_pf_data_next(struct ip_set_hash *h, const struct type_pf_elem *d);
 
 /* Add an element to a hash and update the internal counters when succeeded,
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_ip.c b/kernel/net/netfilter/ipset/ip_set_hash_ip.c
index 5c0b785..df595e7 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_ip.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_ip.c
@@ -114,7 +114,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ip4_data_next(struct ip_set_hash *h, const struct hash_ip4_elem *d)
 {
 	h->next.ip = d->ip;
@@ -298,7 +298,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ip6_data_next(struct ip_set_hash *h, const struct hash_ip6_elem *d)
 {
 }
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_ipport.c b/kernel/net/netfilter/ipset/ip_set_hash_ipport.c
index 6283351..e8b9eaf 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_ipport.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_ipport.c
@@ -129,7 +129,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipport4_data_next(struct ip_set_hash *h,
 		       const struct hash_ipport4_elem *d)
 {
@@ -348,7 +348,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipport6_data_next(struct ip_set_hash *h,
 		       const struct hash_ipport6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_ipportip.c b/kernel/net/netfilter/ipset/ip_set_hash_ipportip.c
index 6a21271..7ceb813 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_ipportip.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_ipportip.c
@@ -132,7 +132,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipportip4_data_next(struct ip_set_hash *h,
 			 const struct hash_ipportip4_elem *d)
 {
@@ -361,7 +361,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipportip6_data_next(struct ip_set_hash *h,
 			 const struct hash_ipportip6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c b/kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c
index 2d5cd4e..8473a01 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_ipportnet.c
@@ -174,7 +174,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipportnet4_data_next(struct ip_set_hash *h,
 			  const struct hash_ipportnet4_elem *d)
 {
@@ -493,7 +493,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_ipportnet6_data_next(struct ip_set_hash *h,
 			  const struct hash_ipportnet6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_net.c b/kernel/net/netfilter/ipset/ip_set_hash_net.c
index 29e94b9..309e7a0 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_net.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_net.c
@@ -152,7 +152,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_net4_data_next(struct ip_set_hash *h,
 		    const struct hash_net4_elem *d)
 {
@@ -382,7 +382,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_net6_data_next(struct ip_set_hash *h,
 		    const struct hash_net6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_netiface.c b/kernel/net/netfilter/ipset/ip_set_hash_netiface.c
index 45a1014..3997f51 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_netiface.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_netiface.c
@@ -273,7 +273,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_netiface4_data_next(struct ip_set_hash *h,
 			 const struct hash_netiface4_elem *d)
 {
@@ -576,7 +576,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_netiface6_data_next(struct ip_set_hash *h,
 			 const struct hash_netiface6_elem *d)
 {
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_netport.c b/kernel/net/netfilter/ipset/ip_set_hash_netport.c
index 7ef700d..c1ff1de 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_netport.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_netport.c
@@ -172,7 +172,7 @@ nla_put_failure:
 #define HOST_MASK	32
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_netport4_data_next(struct ip_set_hash *h,
 			const struct hash_netport4_elem *d)
 {
@@ -452,7 +452,7 @@ nla_put_failure:
 #define HOST_MASK	128
 #include <linux/netfilter/ipset/ip_set_ahash.h>
 
-static inline void
+static INLINE void
 hash_netport6_data_next(struct ip_set_hash *h,
 			const struct hash_netport6_elem *d)
 {

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [ANNOUNCE] ipset 6.16.1 released
  2013-01-10  9:46             ` Jozsef Kadlecsik
@ 2013-01-10  9:55               ` Andreas Herz
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Herz @ 2013-01-10  9:55 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: Jan Engelhardt, netfilter

On 10/01/13 at 10:46, Jozsef Kadlecsik wrote:
> On Thu, 10 Jan 2013, Andreas Herz wrote:
> 
> > On 10/01/13 at 10:16, Jozsef Kadlecsik wrote:
> > > On Thu, 10 Jan 2013, Andreas Herz wrote:
> > > 
> > > > On 10/01/13 at 00:12, Jan Engelhardt wrote:
> > > > > 
> > > > > On Wednesday 2013-01-09 23:44, Jozsef Kadlecsik wrote:
> > > > > >-			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)" \
> > > > > >+			KCFLAGS="-DPACKAGE_VERSION=$(PACKAGE_VERSION)-DINLINE=$(INLINE)" \
> > > > > 
> > > > > You seem to be missing a space before -DINL
> > > > 
> > > > I also changed this in the patch, but still:
> > > > 
> > > > /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:
> > > > In function `hash_ip4_add':
> > > > /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:444:
> > > > sorry, unimplemented: inlining failed in call to 'hash_ip4_data_next':
> > > > function body not available
> > > > /usr/src/redhat/BUILD/ipset-6.16.1/kernel/include/linux/netfilter/ipset/ip_set_ahash.h:485:
> > > > sorry, unimplemented: called from here
> > > 
> > > So in the generated config.h you can find the next, right?
> > > 
> > > /* Inline in prototype supported. */
> > > #define INLINE_IN_PROTOTYPE 1
> > 
> > Yes this part is in the config.h
> 
> OK, let's give one more try. Could you remove the previous one and try the 
> next one? (I don't have access to the given gcc version, so I cannot check 
> it myself.)

Same error message. But with your patch i will work on it and see if i
can update the patch to make it work.

Thanks!

-- 
Andreas Herz

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-01-10  9:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-27 14:16 [ANNOUNCE] ipset 6.16.1 released Jozsef Kadlecsik
2013-01-09 13:48 ` Andreas Herz
2013-01-09 22:44   ` Jozsef Kadlecsik
2013-01-09 23:12     ` Jan Engelhardt
2013-01-10  9:06       ` Jozsef Kadlecsik
2013-01-10  9:07       ` Andreas Herz
2013-01-10  9:16         ` Jozsef Kadlecsik
2013-01-10  9:26           ` Andreas Herz
2013-01-10  9:46             ` Jozsef Kadlecsik
2013-01-10  9:55               ` Andreas Herz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).