ltp.lists.linux.it archive mirror
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH v2 0/3] Fix old toolchain (< v3.14)
@ 2021-09-30 18:30 Petr Vorel
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 1/3] tst_netdevice.c: Drop redundant include Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Petr Vorel @ 2021-09-30 18:30 UTC (permalink / raw)
  To: ltp; +Cc: buildroot

Hi,

NOTE: this fix (3rd commit) is needed obviously due very old toolchain
(sourcery-arm from Buildroot). I suppose it's still used, but can
anybody from Buildroot confirm this?

Kind regards,
Petr

changes v1->v2:
* fixing moving IFA_FLAGS from lapi/rtnetlink.h to lapi/if_addr.h
  (it was by accident done in 2 commits)
* new commit tst_netdevice.c: Drop redundant include

Petr Vorel (3):
  tst_netdevice.c: Drop redundant include
  lapi: Create if_addr.h and reuse it in rtnetlink.h
  lapi/if_addr.h: Define IFA_FLAGS

 include/lapi/if_addr.h            | 19 +++++++++++++++++++
 include/lapi/rtnetlink.h          |  5 +----
 lib/tst_netdevice.c               |  1 -
 testcases/cve/icmp_rate_limit01.c |  3 ++-
 4 files changed, 22 insertions(+), 6 deletions(-)
 create mode 100644 include/lapi/if_addr.h

-- 
2.33.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [RFC PATCH v2 1/3] tst_netdevice.c: Drop redundant include
  2021-09-30 18:30 [LTP] [RFC PATCH v2 0/3] Fix old toolchain (< v3.14) Petr Vorel
@ 2021-09-30 18:30 ` Petr Vorel
  2021-10-06 13:51   ` Cyril Hrubis
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 2/3] lapi: Create if_addr.h and reuse it in rtnetlink.h Petr Vorel
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS Petr Vorel
  2 siblings, 1 reply; 10+ messages in thread
From: Petr Vorel @ 2021-09-30 18:30 UTC (permalink / raw)
  To: ltp; +Cc: buildroot

<linux/rtnetlink.h> is already included in lapi/rtnetlink.h.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 lib/tst_netdevice.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/tst_netdevice.c b/lib/tst_netdevice.c
index ba9a55b70..4a0442932 100644
--- a/lib/tst_netdevice.c
+++ b/lib/tst_netdevice.c
@@ -4,7 +4,6 @@
  */
 
 #include <asm/types.h>
-#include <linux/netlink.h>
 #include <linux/veth.h>
 #include <sys/socket.h>
 #include <net/if.h>
-- 
2.33.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [RFC PATCH v2 2/3] lapi: Create if_addr.h and reuse it in rtnetlink.h
  2021-09-30 18:30 [LTP] [RFC PATCH v2 0/3] Fix old toolchain (< v3.14) Petr Vorel
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 1/3] tst_netdevice.c: Drop redundant include Petr Vorel
@ 2021-09-30 18:30 ` Petr Vorel
  2021-10-06 13:52   ` Cyril Hrubis
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS Petr Vorel
  2 siblings, 1 reply; 10+ messages in thread
From: Petr Vorel @ 2021-09-30 18:30 UTC (permalink / raw)
  To: ltp; +Cc: buildroot

There will be fix in next commit for missing IFA_F_NOPREFIXROUTE which
requires creating lapi/if_addr.h. Thus move IFA_FLAGS to lapi/if_addr.h,
as it belongs there and reuse lapi/if_addr.h in lapi/rtnetlink.h just
like <linux/rtnetlink.h> includes <linux/if_addr.h>.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 include/lapi/if_addr.h   | 16 ++++++++++++++++
 include/lapi/rtnetlink.h |  5 +----
 2 files changed, 17 insertions(+), 4 deletions(-)
 create mode 100644 include/lapi/if_addr.h

diff --git a/include/lapi/if_addr.h b/include/lapi/if_addr.h
new file mode 100644
index 000000000..4e50a0a4e
--- /dev/null
+++ b/include/lapi/if_addr.h
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2021 Petr Vorel <petr.vorel@gmail.com>
+ */
+
+#ifndef LAPI_IF_ADDR_H__
+#define LAPI_IF_ADDR_H__
+
+#include <linux/if_addr.h>
+
+#ifndef IFA_FLAGS
+# define IFA_FLAGS 8
+#endif
+
+
+#endif /* LAPI_IF_ADDR_H__ */
diff --git a/include/lapi/rtnetlink.h b/include/lapi/rtnetlink.h
index 04e9ad51a..089bf1a0d 100644
--- a/include/lapi/rtnetlink.h
+++ b/include/lapi/rtnetlink.h
@@ -5,9 +5,6 @@
 # define LAPI_RTNETLINK_H__
 
 #include <linux/rtnetlink.h>
-
-#ifndef IFA_FLAGS
-# define IFA_FLAGS 8
-#endif
+#include "lapi/if_addr.h"
 
 #endif	/* LAPI_RTNETLINK_H__ */
-- 
2.33.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS
  2021-09-30 18:30 [LTP] [RFC PATCH v2 0/3] Fix old toolchain (< v3.14) Petr Vorel
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 1/3] tst_netdevice.c: Drop redundant include Petr Vorel
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 2/3] lapi: Create if_addr.h and reuse it in rtnetlink.h Petr Vorel
@ 2021-09-30 18:30 ` Petr Vorel
  2021-10-01  9:19   ` Martin Doucha
  2021-10-06 14:00   ` Cyril Hrubis
  2 siblings, 2 replies; 10+ messages in thread
From: Petr Vorel @ 2021-09-30 18:30 UTC (permalink / raw)
  To: ltp; +Cc: buildroot

and use it in icmp_rate_limit01.c.

This fixes error on toolchains with very old kernel headers, e.g.
Buildroot sourcery-arm:

icmp_rate_limit01.c:82:3: error: 'IFA_F_NOPREFIXROUTE' undeclared (first use in this function)
   IFA_F_NOPREFIXROUTE);

Fixed because IFA_F_NOPREFIXROUTE was added in 3.14 and the oldest
system we still support is Cent0S 7 with 3.10 kernel.

NOTE: Cent0S 7 is obviously heavily patched thus it contains
IFA_F_NOPREFIXROUTE and therefore CI build didn't catch this error.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 include/lapi/if_addr.h            | 3 +++
 testcases/cve/icmp_rate_limit01.c | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/lapi/if_addr.h b/include/lapi/if_addr.h
index 4e50a0a4e..0f7e44784 100644
--- a/include/lapi/if_addr.h
+++ b/include/lapi/if_addr.h
@@ -12,5 +12,8 @@
 # define IFA_FLAGS 8
 #endif
 
+#ifndef IFA_F_NOPREFIXROUTE
+# define IFA_F_NOPREFIXROUTE	0x200
+#endif
 
 #endif /* LAPI_IF_ADDR_H__ */
diff --git a/testcases/cve/icmp_rate_limit01.c b/testcases/cve/icmp_rate_limit01.c
index b3a237b30..3ada32675 100644
--- a/testcases/cve/icmp_rate_limit01.c
+++ b/testcases/cve/icmp_rate_limit01.c
@@ -27,11 +27,12 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <linux/if_addr.h>
 #include <linux/errqueue.h>
 
 #include <sched.h>
 #include <limits.h>
+
+#include "lapi/if_addr.h"
 #include "tst_test.h"
 #include "tst_netdevice.h"
 
-- 
2.33.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS Petr Vorel
@ 2021-10-01  9:19   ` Martin Doucha
  2021-10-02 17:23     ` Petr Vorel
  2021-10-06 14:00   ` Cyril Hrubis
  1 sibling, 1 reply; 10+ messages in thread
From: Martin Doucha @ 2021-10-01  9:19 UTC (permalink / raw)
  To: Petr Vorel, ltp

Hi,
commit message for this patch should be "Define IFA_F_NOPREFIXROUTE" but
that can be fixed during merge. Apart from that, the whole patchset
looks good.

Reviewed-by: Martin Doucha <mdoucha@suse.cz>

On 30. 09. 21 20:30, Petr Vorel wrote:
> and use it in icmp_rate_limit01.c.
> 
> This fixes error on toolchains with very old kernel headers, e.g.
> Buildroot sourcery-arm:
> 
> icmp_rate_limit01.c:82:3: error: 'IFA_F_NOPREFIXROUTE' undeclared (first use in this function)
>    IFA_F_NOPREFIXROUTE);
> 
> Fixed because IFA_F_NOPREFIXROUTE was added in 3.14 and the oldest
> system we still support is Cent0S 7 with 3.10 kernel.
> 
> NOTE: Cent0S 7 is obviously heavily patched thus it contains
> IFA_F_NOPREFIXROUTE and therefore CI build didn't catch this error.
> 
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> ---
>  include/lapi/if_addr.h            | 3 +++
>  testcases/cve/icmp_rate_limit01.c | 3 ++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/include/lapi/if_addr.h b/include/lapi/if_addr.h
> index 4e50a0a4e..0f7e44784 100644
> --- a/include/lapi/if_addr.h
> +++ b/include/lapi/if_addr.h
> @@ -12,5 +12,8 @@
>  # define IFA_FLAGS 8
>  #endif
>  
> +#ifndef IFA_F_NOPREFIXROUTE
> +# define IFA_F_NOPREFIXROUTE	0x200
> +#endif
>  
>  #endif /* LAPI_IF_ADDR_H__ */
> diff --git a/testcases/cve/icmp_rate_limit01.c b/testcases/cve/icmp_rate_limit01.c
> index b3a237b30..3ada32675 100644
> --- a/testcases/cve/icmp_rate_limit01.c
> +++ b/testcases/cve/icmp_rate_limit01.c
> @@ -27,11 +27,12 @@
>  #include <sys/socket.h>
>  #include <netinet/in.h>
>  #include <arpa/inet.h>
> -#include <linux/if_addr.h>
>  #include <linux/errqueue.h>
>  
>  #include <sched.h>
>  #include <limits.h>
> +
> +#include "lapi/if_addr.h"
>  #include "tst_test.h"
>  #include "tst_netdevice.h"
>  
> 


-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS
  2021-10-01  9:19   ` Martin Doucha
@ 2021-10-02 17:23     ` Petr Vorel
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2021-10-02 17:23 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Martin,

> Hi,
> commit message for this patch should be "Define IFA_F_NOPREFIXROUTE" but
> that can be fixed during merge. Apart from that, the whole patchset
> looks good.
Ah, keep doing silly errors, thanks for catching this!

> Reviewed-by: Martin Doucha <mdoucha@suse.cz>
Thanks!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [RFC PATCH v2 1/3] tst_netdevice.c: Drop redundant include
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 1/3] tst_netdevice.c: Drop redundant include Petr Vorel
@ 2021-10-06 13:51   ` Cyril Hrubis
  0 siblings, 0 replies; 10+ messages in thread
From: Cyril Hrubis @ 2021-10-06 13:51 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp, buildroot

Hi!
> <linux/rtnetlink.h> is already included in lapi/rtnetlink.h.
                     ^
		     which includes <linux/netlink.h>

I suppose that you have tested this in CI and that it works fine. If
that is so:

Acked-by: Cyril Hrubis <chrubis@suse.cz>

> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> ---
>  lib/tst_netdevice.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/lib/tst_netdevice.c b/lib/tst_netdevice.c
> index ba9a55b70..4a0442932 100644
> --- a/lib/tst_netdevice.c
> +++ b/lib/tst_netdevice.c
> @@ -4,7 +4,6 @@
>   */
>  
>  #include <asm/types.h>
> -#include <linux/netlink.h>
>  #include <linux/veth.h>
>  #include <sys/socket.h>
>  #include <net/if.h>
> -- 
> 2.33.0
> 

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [RFC PATCH v2 2/3] lapi: Create if_addr.h and reuse it in rtnetlink.h
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 2/3] lapi: Create if_addr.h and reuse it in rtnetlink.h Petr Vorel
@ 2021-10-06 13:52   ` Cyril Hrubis
  0 siblings, 0 replies; 10+ messages in thread
From: Cyril Hrubis @ 2021-10-06 13:52 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp, buildroot

Hi!
Looks good.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS
  2021-09-30 18:30 ` [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS Petr Vorel
  2021-10-01  9:19   ` Martin Doucha
@ 2021-10-06 14:00   ` Cyril Hrubis
  2021-10-06 19:08     ` Petr Vorel
  1 sibling, 1 reply; 10+ messages in thread
From: Cyril Hrubis @ 2021-10-06 14:00 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp, buildroot

Hi!
Looks good, as long as it passed CI:

Reviewd-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS
  2021-10-06 14:00   ` Cyril Hrubis
@ 2021-10-06 19:08     ` Petr Vorel
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2021-10-06 19:08 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp, buildroot

Hi Cyril,

> Hi!
> Looks good, as long as it passed CI:
Sure, I tested it not only for affected buildroot, but for LTP CI.

Thus fixed commit message and merged.
Thanks a lot both for review.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2021-10-06 19:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 18:30 [LTP] [RFC PATCH v2 0/3] Fix old toolchain (< v3.14) Petr Vorel
2021-09-30 18:30 ` [LTP] [RFC PATCH v2 1/3] tst_netdevice.c: Drop redundant include Petr Vorel
2021-10-06 13:51   ` Cyril Hrubis
2021-09-30 18:30 ` [LTP] [RFC PATCH v2 2/3] lapi: Create if_addr.h and reuse it in rtnetlink.h Petr Vorel
2021-10-06 13:52   ` Cyril Hrubis
2021-09-30 18:30 ` [LTP] [RFC PATCH v2 3/3] lapi/if_addr.h: Define IFA_FLAGS Petr Vorel
2021-10-01  9:19   ` Martin Doucha
2021-10-02 17:23     ` Petr Vorel
2021-10-06 14:00   ` Cyril Hrubis
2021-10-06 19:08     ` Petr Vorel

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).