summaryrefslogtreecommitdiff
path: root/socket-Do-not-use-AF_NETLINK-in-__opensock.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
commitd20db0561a6a36f914fde030512503b114ef9a0c (patch)
treed4e5e3494d95c269a1cee6195f11bf3201bcadbf /socket-Do-not-use-AF_NETLINK-in-__opensock.patch
parent016343d99b1b269d7246ef1e143d4b54914433d4 (diff)
Diffstat (limited to 'socket-Do-not-use-AF_NETLINK-in-__opensock.patch')
-rw-r--r--socket-Do-not-use-AF_NETLINK-in-__opensock.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/socket-Do-not-use-AF_NETLINK-in-__opensock.patch b/socket-Do-not-use-AF_NETLINK-in-__opensock.patch
new file mode 100644
index 0000000..d78b010
--- /dev/null
+++ b/socket-Do-not-use-AF_NETLINK-in-__opensock.patch
@@ -0,0 +1,40 @@
+From 6eaf10cbb78d22eae7999d9de55f6b93999e0860 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 22 Nov 2021 14:41:14 +0100
+Subject: [PATCH] socket: Do not use AF_NETLINK in __opensock
+
+It is not possible to use interface ioctls with netlink sockets
+on all Linux kernels.
+
+Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+(cherry picked from commit 3d981795cd00cc9b73c3ee5087c308361acd62e5)
+---
+ socket/opensock.c | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/socket/opensock.c b/socket/opensock.c
+index ff94d27a61..3e35821f91 100644
+--- a/socket/opensock.c
++++ b/socket/opensock.c
+@@ -24,17 +24,10 @@
+ int
+ __opensock (void)
+ {
+- /* SOCK_DGRAM is supported by all address families. (Netlink does
+- not support SOCK_STREAM.) */
++ /* SOCK_DGRAM is supported by all address families. */
+ int type = SOCK_DGRAM | SOCK_CLOEXEC;
+ int fd;
+
+-#ifdef AF_NETLINK
+- fd = __socket (AF_NETLINK, type, 0);
+- if (fd >= 0)
+- return fd;
+-#endif
+-
+ fd = __socket (AF_UNIX, type, 0);
+ if (fd >= 0)
+ return fd;
+--
+2.27.0
+