mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] iproute2 build errors when updating to 4.6
@ 2016-05-21 23:55 Clemens Gruber
  2016-05-24  7:20 ` Alexander Aring
  2016-05-24 10:04 ` Michael Olbrich
  0 siblings, 2 replies; 12+ messages in thread
From: Clemens Gruber @ 2016-05-21 23:55 UTC (permalink / raw)
  To: ptxdist

Hi,

I need some features from the new iproute2 4.6, but there seem to be
some kernel header vs glibc header incompatibilities occuring when
building the new iproute2 4.6 for ptxdist.

Two examples of the numerous build errors on ptxdist 2016.04.0, a
toolchain with glibc 2.22 and kernel + kernel-headers version 4.6.

In file included from m_ipt.c:17:0:
../include/linux/if.h:106:19: error: redeclaration of enumerator 'IFF_UP'
 #define IFF_UP    IFF_UP
                   ^
../include/linux/if.h:79:2: note: previous definition of 'IFF_UP' was here
  IFF_UP    = 1<<0,  /* sysfs */
  ^~~~~~

In file included from ../include/xtables.h:16:0,
                 from ../include/iptables.h:5,
                 from m_ipt.c:18:
TOOLCHAIN/sysroot-arm-v7a-linux-gnueabihf/usr/include/net/if.h:111:8: error: redefinition of 'struct ifmap'
 struct ifmap
        ^~~~~
In file included from m_ipt.c:17:0:
../include/linux/if.h:189:8: note: originally defined here
 struct ifmap {
        ^~~~~

There is a commit in version 4.6 of iproute2, which should already have fixed
these build errors:
http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/commit/?id=8a781d7e2580e14f097b23a7c4731bafc800a824

But somehow the problems still occur on ptxdist.

Any ideas what's going on?

Would be great to have the new iproute2 4.6 working in the next ptxdist release :)

Thanks,
Clemens

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-21 23:55 [ptxdist] iproute2 build errors when updating to 4.6 Clemens Gruber
@ 2016-05-24  7:20 ` Alexander Aring
  2016-05-24  7:30   ` Alexander Aring
  2016-05-24 10:04 ` Michael Olbrich
  1 sibling, 1 reply; 12+ messages in thread
From: Alexander Aring @ 2016-05-24  7:20 UTC (permalink / raw)
  To: ptxdist


Hi,

I think I know what's going on here. :-)

On 05/22/2016 01:55 AM, Clemens Gruber wrote:
> Hi,
> 
> I need some features from the new iproute2 4.6, but there seem to be
> some kernel header vs glibc header incompatibilities occuring when
> building the new iproute2 4.6 for ptxdist.
> 
> Two examples of the numerous build errors on ptxdist 2016.04.0, a
> toolchain with glibc 2.22 and kernel + kernel-headers version 4.6.
> 
> In file included from m_ipt.c:17:0:
> ../include/linux/if.h:106:19: error: redeclaration of enumerator 'IFF_UP'
>  #define IFF_UP    IFF_UP
>                    ^
> ../include/linux/if.h:79:2: note: previous definition of 'IFF_UP' was here
>   IFF_UP    = 1<<0,  /* sysfs */
>   ^~~~~~
> 
> In file included from ../include/xtables.h:16:0,
>                  from ../include/iptables.h:5,
>                  from m_ipt.c:18:
> TOOLCHAIN/sysroot-arm-v7a-linux-gnueabihf/usr/include/net/if.h:111:8: error: redefinition of 'struct ifmap'

here, you already replaced the TOOLCHAIN path and it uses the
kernel-headers from toolchain, not ptxdist.

>  struct ifmap
>         ^~~~~
> In file included from m_ipt.c:17:0:
> ../include/linux/if.h:189:8: note: originally defined here

I suppose it's a relative include from your TOOLCHAIN kernel-headers.

The solution would be that you need to tell the iproute2 buildsystem
where the kernel-headers are which you want to use.

E.g. (running fast grep on ptxdist dir)

rules/bridge-utils.make: --with-linux-headers=$(KERNEL_HEADERS_DIR)

which can be checked by:

ptxdist print KERNEL_HEADERS_DIR

in your BSP and this directory should be use to search kernel headers.

>  struct ifmap {
>         ^~~~~
> 
> There is a commit in version 4.6 of iproute2, which should already have fixed
> these build errors:
> http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/commit/?id=8a781d7e2580e14f097b23a7c4731bafc800a824
> 

That's a fallback and it seems that iproute2 prefers the toolchain one.

- Alex

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-24  7:20 ` Alexander Aring
@ 2016-05-24  7:30   ` Alexander Aring
  2016-05-24 13:01     ` Clemens Gruber
  0 siblings, 1 reply; 12+ messages in thread
From: Alexander Aring @ 2016-05-24  7:30 UTC (permalink / raw)
  To: ptxdist

Hi,

again.

On 05/24/2016 09:20 AM, Alexander Aring wrote:
> 
> Hi,
> 
> I think I know what's going on here. :-)
> 
> On 05/22/2016 01:55 AM, Clemens Gruber wrote:
>> Hi,
>>
>> I need some features from the new iproute2 4.6, but there seem to be
>> some kernel header vs glibc header incompatibilities occuring when
>> building the new iproute2 4.6 for ptxdist.
>>
>> Two examples of the numerous build errors on ptxdist 2016.04.0, a
>> toolchain with glibc 2.22 and kernel + kernel-headers version 4.6.
>>
>> In file included from m_ipt.c:17:0:
>> ../include/linux/if.h:106:19: error: redeclaration of enumerator 'IFF_UP'
>>  #define IFF_UP    IFF_UP
>>                    ^
>> ../include/linux/if.h:79:2: note: previous definition of 'IFF_UP' was here
>>   IFF_UP    = 1<<0,  /* sysfs */
>>   ^~~~~~
>>
>> In file included from ../include/xtables.h:16:0,
>>                  from ../include/iptables.h:5,
>>                  from m_ipt.c:18:
>> TOOLCHAIN/sysroot-arm-v7a-linux-gnueabihf/usr/include/net/if.h:111:8: error: redefinition of 'struct ifmap'
> 
> here, you already replaced the TOOLCHAIN path and it uses the
> kernel-headers from toolchain, not ptxdist.
> 
>>  struct ifmap
>>         ^~~~~
>> In file included from m_ipt.c:17:0:
>> ../include/linux/if.h:189:8: note: originally defined here
> 
> I suppose it's a relative include from your TOOLCHAIN kernel-headers.
> 
> The solution would be that you need to tell the iproute2 buildsystem
> where the kernel-headers are which you want to use.
> 
> E.g. (running fast grep on ptxdist dir)
> 
> rules/bridge-utils.make: --with-linux-headers=$(KERNEL_HEADERS_DIR)
> 
> which can be checked by:
> 
> ptxdist print KERNEL_HEADERS_DIR
> 
> in your BSP and this directory should be use to search kernel headers.
> 

Maybe to add KERNEL_INCLUDE=${KERNEL_HEADERS_DIR) in IPROUTE2_MAKE_OPT is
enough here, or leave it empty to use maybe the fallback?

I think to updating to use KERNEL_INCLUDE=${KERNEL_HEADERS_DIR) would be
nice in ptxdist, if this solves your issue.

See [0].

- Alex

[0] http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/tree/Makefile#n9

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-21 23:55 [ptxdist] iproute2 build errors when updating to 4.6 Clemens Gruber
  2016-05-24  7:20 ` Alexander Aring
@ 2016-05-24 10:04 ` Michael Olbrich
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Olbrich @ 2016-05-24 10:04 UTC (permalink / raw)
  To: ptxdist

On Sun, May 22, 2016 at 01:55:13AM +0200, Clemens Gruber wrote:
> I need some features from the new iproute2 4.6, but there seem to be
> some kernel header vs glibc header incompatibilities occuring when
> building the new iproute2 4.6 for ptxdist.
> 
> Two examples of the numerous build errors on ptxdist 2016.04.0, a
> toolchain with glibc 2.22 and kernel + kernel-headers version 4.6.
> 
> In file included from m_ipt.c:17:0:
> ../include/linux/if.h:106:19: error: redeclaration of enumerator 'IFF_UP'
>  #define IFF_UP    IFF_UP
>                    ^
> ../include/linux/if.h:79:2: note: previous definition of 'IFF_UP' was here
>   IFF_UP    = 1<<0,  /* sysfs */
>   ^~~~~~
> 
> In file included from ../include/xtables.h:16:0,
>                  from ../include/iptables.h:5,
>                  from m_ipt.c:18:
> TOOLCHAIN/sysroot-arm-v7a-linux-gnueabihf/usr/include/net/if.h:111:8: error: redefinition of 'struct ifmap'
>  struct ifmap
>         ^~~~~
> In file included from m_ipt.c:17:0:
> ../include/linux/if.h:189:8: note: originally defined here
>  struct ifmap {
>         ^~~~~
> 
> There is a commit in version 4.6 of iproute2, which should already have fixed
> these build errors:
> http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/commit/?id=8a781d7e2580e14f097b23a7c4731bafc800a824
> 
> But somehow the problems still occur on ptxdist.
> 
> Any ideas what's going on?

I think that fix only works if net/if.h is included before linux/if.h. And
that's not the case in m_ipt.c.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-24  7:30   ` Alexander Aring
@ 2016-05-24 13:01     ` Clemens Gruber
  2016-05-24 15:24       ` Alexander Aring
  0 siblings, 1 reply; 12+ messages in thread
From: Clemens Gruber @ 2016-05-24 13:01 UTC (permalink / raw)
  To: ptxdist

Hi Alex, Hi Michael,

On Tue, May 24, 2016 at 09:30:41AM +0200, Alexander Aring wrote:
> Maybe to add KERNEL_INCLUDE=${KERNEL_HEADERS_DIR) in IPROUTE2_MAKE_OPT is
> enough here, or leave it empty to use maybe the fallback?
> 
> I think to updating to use KERNEL_INCLUDE=${KERNEL_HEADERS_DIR) would be
> nice in ptxdist, if this solves your issue.
> 

Thank you for your help!

I tried adding KERNEL_INCLUDE=$(KERNEL_HEADERS_DIR) to the MAKE_OPTS but
that alone did not fix the problem. It still used the toolchain headers.

Including net/if.h before linux/if.h fixes the redefinition errors, but now I
get: fatal error: xtables-version.h: No such file or directory
Although the iptables dependency should be optional.

Is this a bug in the hand-crafted configure script of iproute2 and can
you reproduce this on your machines?

Clemens

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-24 13:01     ` Clemens Gruber
@ 2016-05-24 15:24       ` Alexander Aring
  2016-05-24 18:08         ` Alexander Aring
  0 siblings, 1 reply; 12+ messages in thread
From: Alexander Aring @ 2016-05-24 15:24 UTC (permalink / raw)
  To: ptxdist


Hi,

On 05/24/2016 03:01 PM, Clemens Gruber wrote:
> Hi Alex, Hi Michael,
> 
> On Tue, May 24, 2016 at 09:30:41AM +0200, Alexander Aring wrote:
>> Maybe to add KERNEL_INCLUDE=${KERNEL_HEADERS_DIR) in IPROUTE2_MAKE_OPT is
>> enough here, or leave it empty to use maybe the fallback?
>>
>> I think to updating to use KERNEL_INCLUDE=${KERNEL_HEADERS_DIR) would be
>> nice in ptxdist, if this solves your issue.
>>
> 
> Thank you for your help!
> 
> I tried adding KERNEL_INCLUDE=$(KERNEL_HEADERS_DIR) to the MAKE_OPTS but
> that alone did not fix the problem. It still used the toolchain headers.
> 
> Including net/if.h before linux/if.h fixes the redefinition errors, but now I
> get: fatal error: xtables-version.h: No such file or directory
> Although the iptables dependency should be optional.
> 
> Is this a bug in the hand-crafted configure script of iproute2 and can
> you reproduce this on your machines?
> 

I think somebody breaks the "TC_CONFIG_XT:=n" and TC_CONFIG_XT_OLD:=n and
TC_CONFIG_XT_OLD_H:=n upstream.

You can see these settings and what will be build here [0]. In our case
and what's worked before it is:

TCMODULES += m_ipt.o

this is where lot of errors occurs.

These errors are mainly two errors:

1. redefinition erros.

2. compile doesn't know about "struct iptables_target".

---

I fixed 1 as by some workaround and tried to get the "why" in "2.". Then
I found [1], which completely removes "struct iptables_target" from the
internal iptables headers of iproute2 (I think they need to update
m_ipt.c or add a second iptables header here and somebody don't did that,
depends if iptables just move this struct or deleted it).

I need to look in iptables source for that to be sure.

Nevertheless I tried several configs by some "iptables" replacement
modules for m_ipt.o, see [0] (I hope you don't need that) and figured out the
following works for me, but I think we need a dependency on IPTABLES then.

---

diff --git a/rules/iproute2.in b/rules/iproute2.in
index dadad03..20cc83d 100644
--- a/rules/iproute2.in
+++ b/rules/iproute2.in
@@ -3,6 +3,7 @@
 menuconfig IPROUTE2
        tristate
        prompt "iproute2                      "
+       select IPTABLES
        select DB if IPROUTE2_ARPD
        select LIBC_DL
        select LIBC_M
diff --git a/rules/iproute2.make b/rules/iproute2.make
index 34f93f4..01936eb 100644
--- a/rules/iproute2.make
+++ b/rules/iproute2.make
@@ -17,8 +17,8 @@ PACKAGES-$(PTXCONF_IPROUTE2) += iproute2
 #
 # Paths and names
 #
-IPROUTE2_VERSION       := 4.4.0
-IPROUTE2_MD5           := d762653ec3e1ab0d4a9689e169ca184f
+IPROUTE2_VERSION       := 4.6.0
+IPROUTE2_MD5           := d015e437e4f744d51d3a1a53341826d5
 IPROUTE2               := iproute2-$(IPROUTE2_VERSION)
 IPROUTE2_SUFFIX                := tar.xz
 IPROUTE2_URL           := $(call ptx/mirror, KERNEL, utils/net/iproute2/$(IPROUTE2).$(IPROUTE2_SUFFIX))
@@ -38,7 +38,7 @@ $(STATEDIR)/iproute2.prepare:
        @$(call world/prepare, IPROUTE2)
 # overwrite options we don't want, or may be misdetected
        @echo 'TC_CONFIG_ATM:=n'        >> $(IPROUTE2_DIR)/Config
-       @echo 'TC_CONFIG_XT:=n'         >> $(IPROUTE2_DIR)/Config
+       @echo 'TC_CONFIG_XT:=y'         >> $(IPROUTE2_DIR)/Config
        @echo 'IPT_LIB_DIR:=/usr/lib'   >> $(IPROUTE2_DIR)/Config
        @echo 'TC_CONFIG_ELF:=n'        >> $(IPROUTE2_DIR)/Config
 ifndef PTXCONF_GLOBAL_SELINUX
@@ -53,7 +53,8 @@ endif
 IPROUTE2_MAKE_OPT := \
        DESTDIR=$(SYSROOT) \
        LDFLAGS='-rdynamic' \
-       WFLAGS="-Wall"
+       WFLAGS="-Wall" \
+       KERNEL_INCLUDE="${KERNEL_HEADERS_DIR}/include/"
 
 # ----------------------------------------------------------------------------
 # Target-Install

---

For the TC_CONFIG_XT:=y, maybe it's worth to look into buildroot file, they
also replace some $(SED) "s/-DIPT/-DXT/" $(IPROUTE2_DIR)/tc/Makefile,
see [2], but either buildroot doesn't has support for 4.6.0 iproute2.

According to the buildfail of "m_ipt.o", this should be fixed mainline
somehow and can't working with the iptables include files which are
copied into include dir of iproute2. :-/

- Alex

[0] http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/tree/tc/Makefile#n82
[1] http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/diff/?id=5cd1adba79d33644debd4ba498bb262c5bebcfba
[2] https://git.buildroot.net/buildroot/tree/package/iproute2/iproute2.mk

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-24 15:24       ` Alexander Aring
@ 2016-05-24 18:08         ` Alexander Aring
  2016-05-25 17:42           ` Clemens Gruber
  0 siblings, 1 reply; 12+ messages in thread
From: Alexander Aring @ 2016-05-24 18:08 UTC (permalink / raw)
  To: ptxdist


Hi,

On 05/24/2016 05:24 PM, Alexander Aring wrote:
...
> 
> According to the buildfail of "m_ipt.o", this should be fixed mainline
> somehow and can't working with the iptables include files which are
> copied into include dir of iproute2. :-/
> 

from what I noticed from iptables git log, etc, they renamed
iptables_target to xtables_target etc, some function are not exported
from lib anymore (if they are still used in m_ipt.o then do a static
inline).

Nevertheless, here is the patch which "maybe?" should go mainline to
iproute2 to work with the new API header of iptables, but I didn't
tested it. :-)

---

diff --git a/tc/m_ipt.c b/tc/m_ipt.c
index d088f5e..098f610 100644
--- a/tc/m_ipt.c
+++ b/tc/m_ipt.c
@@ -14,7 +14,6 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <linux/if.h>
 #include <iptables.h>
 #include <linux/netfilter.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
@@ -51,7 +50,7 @@ static struct option original_opts[] = {
 	{0, 0, 0, 0}
 };
 
-static struct iptables_target *t_list;
+static struct xtables_target *t_list;
 static struct option *opts = original_opts;
 static unsigned int global_option_offset;
 #define OPTION_OFFSET 256
@@ -59,32 +58,21 @@ static unsigned int global_option_offset;
 char *lib_dir;
 
 void
-register_target(struct iptables_target *me)
+xtables_register_target(struct xtables_target *me)
 {
-/*      fprintf(stderr, "\nDummy register_target %s\n", me->name);
-*/
 	me->next = t_list;
 	t_list = me;
 
 }
 
-void
-xtables_register_target(struct iptables_target *me)
-{
-	me->next = t_list;
-	t_list = me;
-}
-
-void
-exit_tryhelp(int status)
+static void exit_tryhelp(int status)
 {
 	fprintf(stderr, "Try `%s -h' or '%s --help' for more information.\n",
 		pname, pname);
 	exit(status);
 }
 
-void
-exit_error(enum exittype status, char *msg, ...)
+static void exit_error(enum xtables_exittype status, char *msg, ...)
 {
 	va_list args;
 
@@ -106,61 +94,6 @@ They should really have them as a library so i can link to them
 Email them next time i remember
 */
 
-char *
-addr_to_dotted(const struct in_addr *addrp)
-{
-	static char buf[20];
-	const unsigned char *bytep;
-
-	bytep = (const unsigned char *) &(addrp->s_addr);
-	sprintf(buf, "%d.%d.%d.%d", bytep[0], bytep[1], bytep[2], bytep[3]);
-	return buf;
-}
-
-int string_to_number_ll(const char *s, unsigned long long min,
-			unsigned long long max,
-		 unsigned long long *ret)
-{
-	unsigned long long number;
-	char *end;
-
-	/* Handle hex, octal, etc. */
-	errno = 0;
-	number = strtoull(s, &end, 0);
-	if (*end == '\0' && end != s) {
-		/* we parsed a number, let's see if we want this */
-		if (errno != ERANGE && min <= number && (!max || number <= max)) {
-			*ret = number;
-			return 0;
-		}
-	}
-	return -1;
-}
-
-int string_to_number_l(const char *s, unsigned long min, unsigned long max,
-		       unsigned long *ret)
-{
-	int result;
-	unsigned long long number;
-
-	result = string_to_number_ll(s, min, max, &number);
-	*ret = (unsigned long)number;
-
-	return result;
-}
-
-int string_to_number(const char *s, unsigned int min, unsigned int max,
-		unsigned int *ret)
-{
-	int result;
-	unsigned long number;
-
-	result = string_to_number_l(s, min, max, &number);
-	*ret = (unsigned int)number;
-
-	return result;
-}
-
 static void free_opts(struct option *local_opts)
 {
 	if (local_opts != original_opts) {
@@ -205,10 +138,10 @@ fw_calloc(size_t count, size_t size)
 	return p;
 }
 
-static struct iptables_target *
+static struct xtables_target *
 find_t(char *name)
 {
-	struct iptables_target *m;
+	struct xtables_target *m;
 
 	for (m = t_list; m; m = m->next) {
 		if (strcmp(m->name, name) == 0)
@@ -218,13 +151,13 @@ find_t(char *name)
 	return NULL;
 }
 
-static struct iptables_target *
+static struct xtables_target *
 get_target_name(const char *name)
 {
 	void *handle;
 	char *error;
 	char *new_name, *lname;
-	struct iptables_target *m;
+	struct xtables_target *m;
 	char path[strlen(lib_dir) + sizeof("/libipt_.so") + strlen(name)];
 
 #ifdef NO_SHARED_LIBS
@@ -291,7 +224,7 @@ get_target_name(const char *name)
 
 	m = dlsym(handle, new_name);
 	if ((error = dlerror()) != NULL) {
-		m = (struct iptables_target *) dlsym(handle, lname);
+		m = (struct xtables_target *) dlsym(handle, lname);
 		if ((error = dlerror()) != NULL) {
 			m = find_t(new_name);
 			if (m == NULL) {
@@ -313,42 +246,6 @@ get_target_name(const char *name)
 	return m;
 }
 
-
-struct in_addr *dotted_to_addr(const char *dotted)
-{
-	static struct in_addr addr;
-	unsigned char *addrp;
-	char *p, *q;
-	unsigned int onebyte;
-	int i;
-	char buf[20];
-
-	/* copy dotted string, because we need to modify it */
-	strncpy(buf, dotted, sizeof(buf) - 1);
-	addrp = (unsigned char *) &(addr.s_addr);
-
-	p = buf;
-	for (i = 0; i < 3; i++) {
-		if ((q = strchr(p, '.')) == NULL)
-			return (struct in_addr *) NULL;
-
-		*q = '\0';
-		if (string_to_number(p, 0, 255, &onebyte) == -1)
-			return (struct in_addr *) NULL;
-
-		addrp[i] = (unsigned char) onebyte;
-		p = q + 1;
-	}
-
-	/* we've checked 3 bytes, now we check the last one */
-	if (string_to_number(p, 0, 255, &onebyte) == -1)
-		return (struct in_addr *) NULL;
-
-	addrp[3] = (unsigned char) onebyte;
-
-	return &addr;
-}
-
 static void set_revision(char *name, u_int8_t revision)
 {
 	/* Old kernel sources don't have ".revision" field,
@@ -360,23 +257,20 @@ static void set_revision(char *name, u_int8_t revision)
 /*
  * we may need to check for version mismatch
 */
-int
-build_st(struct iptables_target *target, struct ipt_entry_target *t)
+static int build_st(struct xtables_target *target, struct ipt_entry_target *t)
 {
-	unsigned int nfcache = 0;
-
 	if (target) {
 		size_t size;
 
 		size =
-		    IPT_ALIGN(sizeof(struct ipt_entry_target)) + target->size;
+		    XT_ALIGN(sizeof(struct ipt_entry_target)) + target->size;
 
 		if (t == NULL) {
 			target->t = fw_calloc(1, size);
 			target->t->u.target_size = size;
 
 			if (target->init != NULL)
-				target->init(target->t, &nfcache);
+				target->init(target->t);
 			set_revision(target->t->u.user.name, target->revision);
 		} else {
 			target->t = t;
@@ -391,7 +285,7 @@ build_st(struct iptables_target *target, struct ipt_entry_target *t)
 static int parse_ipt(struct action_util *a, int *argc_p,
 		     char ***argv_p, int tca_id, struct nlmsghdr *n)
 {
-	struct iptables_target *m = NULL;
+	struct xtables_target *m = NULL;
 	struct ipt_entry fw;
 	struct rtattr *tail;
 	int c;
@@ -574,7 +468,7 @@ print_ipt(struct action_util *au, FILE * f, struct rtattr *arg)
 		fprintf(f, "\t[NULL ipt target parameters ]\n");
 		return -1;
 	} else {
-		struct iptables_target *m = NULL;
+		struct xtables_target *m = NULL;
 
 		t = RTA_DATA(tb[TCA_IPT_TARG]);
 		m = get_target_name(t->u.user.name);

- Alex

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-24 18:08         ` Alexander Aring
@ 2016-05-25 17:42           ` Clemens Gruber
  2016-05-29 18:31             ` Alexander Aring
  0 siblings, 1 reply; 12+ messages in thread
From: Clemens Gruber @ 2016-05-25 17:42 UTC (permalink / raw)
  To: ptxdist

Hi Alex,

On Tue, May 24, 2016 at 08:08:25PM +0200, Alexander Aring wrote:
> from what I noticed from iptables git log, etc, they renamed
> iptables_target to xtables_target etc, some function are not exported
> from lib anymore (if they are still used in m_ipt.o then do a static
> inline).
> 
> Nevertheless, here is the patch which "maybe?" should go mainline to
> iproute2 to work with the new API header of iptables, but I didn't
> tested it. :-)

Nice, thank you! :)

With your patch, iproute2 4.6 can be built without errors and does work
as expected as far as I can tell for now. Looks good!

Cheers,
Clemens

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-25 17:42           ` Clemens Gruber
@ 2016-05-29 18:31             ` Alexander Aring
  2016-05-30 19:59               ` Clemens Gruber
  0 siblings, 1 reply; 12+ messages in thread
From: Alexander Aring @ 2016-05-29 18:31 UTC (permalink / raw)
  To: ptxdist


Hi,

On 05/25/2016 07:42 PM, Clemens Gruber wrote:
> Hi Alex,
> 
> On Tue, May 24, 2016 at 08:08:25PM +0200, Alexander Aring wrote:
>> from what I noticed from iptables git log, etc, they renamed
>> iptables_target to xtables_target etc, some function are not exported
>> from lib anymore (if they are still used in m_ipt.o then do a static
>> inline).
>>
>> Nevertheless, here is the patch which "maybe?" should go mainline to
>> iproute2 to work with the new API header of iptables, but I didn't
>> tested it. :-)
> 
> Nice, thank you! :)
> 
> With your patch, iproute2 4.6 can be built without errors and does work
> as expected as far as I can tell for now. Looks good!
> 

I just sent the patch to netdev for iproute2 and cc you. If all is fine
from netdev people, do you want to send your work for iproute2 version
bump to mainline ptxdist?

- Alex

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-29 18:31             ` Alexander Aring
@ 2016-05-30 19:59               ` Clemens Gruber
  2016-06-15 18:37                 ` Alexander Aring
  0 siblings, 1 reply; 12+ messages in thread
From: Clemens Gruber @ 2016-05-30 19:59 UTC (permalink / raw)
  To: ptxdist

Hi,

On Sun, May 29, 2016 at 08:31:07PM +0200, Alexander Aring wrote:
> I just sent the patch to netdev for iproute2 and cc you. If all is fine
> from netdev people, do you want to send your work for iproute2 version
> bump to mainline ptxdist?

Great!

Hm, I think you deserve the credit for the ptxdist change too! Also, I
am not sure if we should add your patch to the patches directory or wait
for upstream to fix it and delay the version bump until then?

Thanks,
Clemens

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-05-30 19:59               ` Clemens Gruber
@ 2016-06-15 18:37                 ` Alexander Aring
  2016-06-16 16:19                   ` Clemens Gruber
  0 siblings, 1 reply; 12+ messages in thread
From: Alexander Aring @ 2016-06-15 18:37 UTC (permalink / raw)
  To: ptxdist


Hi,

On 05/30/2016 09:59 PM, Clemens Gruber wrote:
> Hi,
> 
> On Sun, May 29, 2016 at 08:31:07PM +0200, Alexander Aring wrote:
>> I just sent the patch to netdev for iproute2 and cc you. If all is fine
>> from netdev people, do you want to send your work for iproute2 version
>> bump to mainline ptxdist?
> 
> Great!
> 
> Hm, I think you deserve the credit for the ptxdist change too! Also, I
> am not sure if we should add your patch to the patches directory or wait
> for upstream to fix it and delay the version bump until then?
> 

patch came upstream today, but I think it takes some time for new
release. What are the great new features in new iproute2 version?

I think it's fine to version bump + add patches for iproute2.

- Alex

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] iproute2 build errors when updating to 4.6
  2016-06-15 18:37                 ` Alexander Aring
@ 2016-06-16 16:19                   ` Clemens Gruber
  0 siblings, 0 replies; 12+ messages in thread
From: Clemens Gruber @ 2016-06-16 16:19 UTC (permalink / raw)
  To: ptxdist

Hi,

On Wed, Jun 15, 2016 at 08:37:10PM +0200, Alexander Aring wrote:
> patch came upstream today, but I think it takes some time for new
> release. What are the great new features in new iproute2 version?

For me, the bridging and multicast improvements were important and a
bugfix in tc, but in general, the devlink support is probably the most
significant new feature, but I am not using that. It's mostly
incremental improvements all over the place.

I think we can wait until Linus releases 4.7, then there will be a new
iproute2 version as well and we can upgrade.
What do you think?

Regards,
Clemens

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2016-06-16 16:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-21 23:55 [ptxdist] iproute2 build errors when updating to 4.6 Clemens Gruber
2016-05-24  7:20 ` Alexander Aring
2016-05-24  7:30   ` Alexander Aring
2016-05-24 13:01     ` Clemens Gruber
2016-05-24 15:24       ` Alexander Aring
2016-05-24 18:08         ` Alexander Aring
2016-05-25 17:42           ` Clemens Gruber
2016-05-29 18:31             ` Alexander Aring
2016-05-30 19:59               ` Clemens Gruber
2016-06-15 18:37                 ` Alexander Aring
2016-06-16 16:19                   ` Clemens Gruber
2016-05-24 10:04 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox