kumquat-buildroot/package/libqmi/0001-libqmi-fix-build-when-ARPHRD_RAWIP-isn-t-defined-in-.patch
Aleksander Morgado 91e97b56dc package/libqmi: fix build when libc doesn't define ARPHRD_RAWIP
The ARPHRD_RAWIP symbol is used in the rmnet backend in the link
management support now included in libqmi.

If libc doesn't provide this symbol yet, define it ourselves. The
symbol will only be used if rmnet is enabled in the kernel anyway.

This patch will be included in the next libqmi 1.28.4.

Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
[yann.morin.1998@free.fr:
  - do an actual backport now it's been applied upstream
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-03-30 21:41:03 +02:00

40 lines
1.2 KiB
Diff

From cdec8660427d2895415f1d84426e39d1ed145136 Mon Sep 17 00:00:00 2001
From: Aleksander Morgado <aleksander@aleksander.es>
Date: Tue, 30 Mar 2021 00:13:45 +0200
Subject: [PATCH] libqmi: fix build when ARPHRD_RAWIP isn't defined in libc
The kernel may be new enough to have rmnet support, but it could be
that libc doesn't have ARPHRD_RAWIP defined yet; if so, just define it
ourselves.
Fixes http://autobuild.buildroot.org/results/c8853b7161bd85d46c1282c6c097e7ef4042ae68
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
---
src/libqmi-glib/qmi-net-port-manager-rmnet.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/libqmi-glib/qmi-net-port-manager-rmnet.c b/src/libqmi-glib/qmi-net-port-manager-rmnet.c
index eb26129..571d4c4 100644
--- a/src/libqmi-glib/qmi-net-port-manager-rmnet.c
+++ b/src/libqmi-glib/qmi-net-port-manager-rmnet.c
@@ -24,8 +24,15 @@
#include <linux/if_link.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
+
#include <net/if.h>
#include <net/if_arp.h>
+
+/* The if_arp.h from libc may not have this symbol yet */
+#if !defined ARPHRD_RAWIP
+#define ARPHRD_RAWIP 519
+#endif
+
#include <sys/socket.h>
#include <sys/types.h>
#include <string.h>
--
2.30.1