* [Buildroot] [PATCH 1/1] package/pppd: fix build with kernel < 4.7
@ 2024-05-05 15:53 Fabrice Fontaine
2024-05-06 19:28 ` Thomas Petazzoni via buildroot
2024-05-27 5:53 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2024-05-05 15:53 UTC (permalink / raw)
To: buildroot; +Cc: Bernd Kuhls, Fabrice Fontaine
Fix the following build failure with kernel < 4.7 raised since bump to
version 2.5.0 in commit 0c15169f5ae57d88a77df34cc896044a37c9597b and
https://github.com/ppp-project/ppp/commit/81ad945630120cc1c27c8bb00503be42b76ff202:
sys-linux.c: In function 'get_ppp_stats_rtnetlink':
sys-linux.c:1783:29: error: field 'ifsm' has incomplete type
1783 | struct if_stats_msg ifsm;
| ^~~~
Fixes:
- http://autobuild.buildroot.org/results/82392df447f650f241f23e59e65131fb4a930010
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
| 66 +++++++++++++++++++
1 file changed, 66 insertions(+)
create mode 100644 package/pppd/0005-pppd-sys-linux-Fix-compile-with-older-Linux-kernel-headers.patch
--git a/package/pppd/0005-pppd-sys-linux-Fix-compile-with-older-Linux-kernel-headers.patch b/package/pppd/0005-pppd-sys-linux-Fix-compile-with-older-Linux-kernel-headers.patch
new file mode 100644
index 0000000000..46c293103a
--- /dev/null
+++ b/package/pppd/0005-pppd-sys-linux-Fix-compile-with-older-Linux-kernel-headers.patch
@@ -0,0 +1,66 @@
+From 7a3f478a4b7128d4f70ea64d99fedec766b1c009 Mon Sep 17 00:00:00 2001
+From: Jaco Kroon <jaco@uls.co.za>
+Date: Tue, 31 Oct 2023 11:47:21 +0200
+Subject: [PATCH] pppd/sys-linux: Fix compile with older Linux kernel headers
+ (#452)
+
+When compiling pppd against kernel headers which don't provide
+the definitions for the NETLINK mechanisms, leave out the code
+which uses NETLINK, so as to avoid getting compile errors.
+
+Upstream commit in Linux refers.
+
+commit 10c9ead9f3c6bb24bddc9a96681f7d58e6623966
+Author: Roopa Prabhu <roopa@cumulusnetworks.com>
+Date: Wed Apr 20 08:43:43 2016 -0700
+rtnetlink: add new RTM_GETSTATS message to dump link stats
+
+This commit adds the #defines and structs used, so simply not compiling
+this code if the required #defines isn't there should solve the problem.
+
+Closes: #450
+
+Signed-off-by: Jaco Kroon <jaco@uls.co.za>
+Upstream: https://github.com/ppp-project/ppp/commit/7a3f478a4b7128d4f70ea64d99fedec766b1c009
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ pppd/sys-linux.c | 12 ++----------
+ 1 file changed, 2 insertions(+), 10 deletions(-)
+
+diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
+index 561b150f2..a8d6cd95b 100644
+--- a/pppd/sys-linux.c
++++ b/pppd/sys-linux.c
+@@ -131,16 +131,6 @@
+ #include <linux/netlink.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/if_link.h>
+-
+-/* Attempt at retaining compile-support with older than 4.7 kernels, or kernels
+- * where RTM_NEWSTATS isn't defined for whatever reason.
+- */
+-#ifndef RTM_NEWSTATS
+-#define RTM_NEWSTATS 92
+-#define RTM_GETSTATS 94
+-#define IFLA_STATS_LINK_64 1
+-#endif
+-
+ #include <linux/if_addr.h>
+
+ /* glibc versions prior to 2.24 do not define SOL_NETLINK */
+@@ -1776,6 +1766,7 @@ get_ppp_stats_ioctl(int u, struct pppd_stats *stats)
+ static int
+ get_ppp_stats_rtnetlink(int u, struct pppd_stats *stats)
+ {
++#ifdef RTM_NEWSTATS
+ static int fd = -1;
+
+ struct {
+@@ -1825,6 +1816,7 @@ get_ppp_stats_rtnetlink(int u, struct pppd_stats *stats)
+ err:
+ close(fd);
+ fd = -1;
++#endif
+ return 0;
+ }
+
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Buildroot] [PATCH 1/1] package/pppd: fix build with kernel < 4.7
2024-05-05 15:53 [Buildroot] [PATCH 1/1] package/pppd: fix build with kernel < 4.7 Fabrice Fontaine
@ 2024-05-06 19:28 ` Thomas Petazzoni via buildroot
2024-05-27 5:53 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-05-06 19:28 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: Bernd Kuhls, buildroot
On Sun, 5 May 2024 17:53:49 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> Fix the following build failure with kernel < 4.7 raised since bump to
> version 2.5.0 in commit 0c15169f5ae57d88a77df34cc896044a37c9597b and
> https://github.com/ppp-project/ppp/commit/81ad945630120cc1c27c8bb00503be42b76ff202:
>
> sys-linux.c: In function 'get_ppp_stats_rtnetlink':
> sys-linux.c:1783:29: error: field 'ifsm' has incomplete type
> 1783 | struct if_stats_msg ifsm;
> | ^~~~
>
> Fixes:
> - http://autobuild.buildroot.org/results/82392df447f650f241f23e59e65131fb4a930010
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> ...pile-with-older-Linux-kernel-headers.patch | 66 +++++++++++++++++++
> 1 file changed, 66 insertions(+)
> create mode 100644 package/pppd/0005-pppd-sys-linux-Fix-compile-with-older-Linux-kernel-headers.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/pppd: fix build with kernel < 4.7
2024-05-05 15:53 [Buildroot] [PATCH 1/1] package/pppd: fix build with kernel < 4.7 Fabrice Fontaine
2024-05-06 19:28 ` Thomas Petazzoni via buildroot
@ 2024-05-27 5:53 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-05-27 5:53 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: Bernd Kuhls, buildroot
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
> Fix the following build failure with kernel < 4.7 raised since bump to
> version 2.5.0 in commit 0c15169f5ae57d88a77df34cc896044a37c9597b and
> https://github.com/ppp-project/ppp/commit/81ad945630120cc1c27c8bb00503be42b76ff202:
> sys-linux.c: In function 'get_ppp_stats_rtnetlink':
> sys-linux.c:1783:29: error: field 'ifsm' has incomplete type
> 1783 | struct if_stats_msg ifsm;
> | ^~~~
> Fixes:
> - http://autobuild.buildroot.org/results/82392df447f650f241f23e59e65131fb4a930010
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Committed to 2024.02.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-27 5:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-05 15:53 [Buildroot] [PATCH 1/1] package/pppd: fix build with kernel < 4.7 Fabrice Fontaine
2024-05-06 19:28 ` Thomas Petazzoni via buildroot
2024-05-27 5:53 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox