diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-08-28 11:48:48 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-08-28 23:57:15 -0700 |
commit | 6dd82f3a04966c1cdf80ce76dfb7f5660449a6ad (patch) | |
tree | 9c5044735af72abaa035bd991f7ef560e6c365fe | |
parent | 3dd74712ed7b5a281622af576cf8ffb6c68e9cb0 (diff) | |
download | meta-openembedded-6dd82f3a04966c1cdf80ce76dfb7f5660449a6ad.tar.gz |
python3-netifaces: Fix build with python3 and musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-python/recipes-devtools/python/python3-netifaces/0001-netifaces-initialize-msghdr-in-a-portable-way.patch | 49 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-netifaces_0.11.0.bb | 6 |
2 files changed, 53 insertions, 2 deletions
diff --git a/meta-python/recipes-devtools/python/python3-netifaces/0001-netifaces-initialize-msghdr-in-a-portable-way.patch b/meta-python/recipes-devtools/python/python3-netifaces/0001-netifaces-initialize-msghdr-in-a-portable-way.patch new file mode 100644 index 000000000..7ff86cc8b --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-netifaces/0001-netifaces-initialize-msghdr-in-a-portable-way.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From cbcd19f38ae4b31c57c57ce3619b8d2674defb68 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 28 Aug 2022 08:11:27 -0700 | ||
4 | Subject: [PATCH] netifaces: initialize msghdr in a portable way | ||
5 | |||
6 | musl has padding bytes inside the msghdr struct which means initializing | ||
7 | full structure will cause wrong assignments, doing partial assignment is | ||
8 | more portable and assign the elements after that | ||
9 | |||
10 | Fixes | ||
11 | netifaces.c:1808:9: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion] | ||
12 | NULL, | ||
13 | ^~~~ | ||
14 | |||
15 | Upstream-Status: Inappropriate [Upstream Repo is read-only] | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | netifaces.c | 15 ++++++--------- | ||
19 | 1 file changed, 6 insertions(+), 9 deletions(-) | ||
20 | |||
21 | diff --git a/netifaces.c b/netifaces.c | ||
22 | index 839c42c..7da78e7 100644 | ||
23 | --- a/netifaces.c | ||
24 | +++ b/netifaces.c | ||
25 | @@ -1800,15 +1800,12 @@ gateways (PyObject *self) | ||
26 | do { | ||
27 | struct sockaddr_nl sanl_from; | ||
28 | struct iovec iov = { msgbuf, bufsize }; | ||
29 | - struct msghdr msghdr = { | ||
30 | - &sanl_from, | ||
31 | - sizeof(sanl_from), | ||
32 | - &iov, | ||
33 | - 1, | ||
34 | - NULL, | ||
35 | - 0, | ||
36 | - 0 | ||
37 | - }; | ||
38 | + struct msghdr msghdr = { 0 }; | ||
39 | + | ||
40 | + msghdr.msg_name = &sanl_from; | ||
41 | + msghdr.msg_namelen = sizeof(sanl_from); | ||
42 | + msghdr.msg_iov = &iov; | ||
43 | + msghdr.msg_iovlen = 1; | ||
44 | int nllen; | ||
45 | |||
46 | ret = recvmsg (s, &msghdr, 0); | ||
47 | -- | ||
48 | 2.37.2 | ||
49 | |||
diff --git a/meta-python/recipes-devtools/python/python3-netifaces_0.11.0.bb b/meta-python/recipes-devtools/python/python3-netifaces_0.11.0.bb index 09e54b0ba..f211c6954 100644 --- a/meta-python/recipes-devtools/python/python3-netifaces_0.11.0.bb +++ b/meta-python/recipes-devtools/python/python3-netifaces_0.11.0.bb | |||
@@ -4,6 +4,8 @@ SECTION = "devel/python" | |||
4 | LICENSE = "MIT" | 4 | LICENSE = "MIT" |
5 | LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=a53cbc7cb75660694e138ba973c148df" | 5 | LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=a53cbc7cb75660694e138ba973c148df" |
6 | 6 | ||
7 | SRC_URI[sha256sum] = "043a79146eb2907edf439899f262b3dfe41717d34124298ed281139a8b93ca32" | ||
8 | |||
9 | inherit pypi setuptools3 | 7 | inherit pypi setuptools3 |
8 | |||
9 | SRC_URI += "file://0001-netifaces-initialize-msghdr-in-a-portable-way.patch" | ||
10 | |||
11 | SRC_URI[sha256sum] = "043a79146eb2907edf439899f262b3dfe41717d34124298ed281139a8b93ca32" | ||