Skip to contentSkip to conversation

package/macchanger: fix musl build

PATCH New Bernd Kuhls 3 participants 4 messages Jan 23, 2016 – May 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/macchanger: fix musl build

Fixes
http://autobuild.buildroot.net/results/2bc/2bccf3fd7060870a337c0bd7a9a750d0ad4e2c1c/
http://autobuild.buildroot.net/results/7d3/7d3f5bb036039b6966682eaf59b8600849f27034/

---
 package/macchanger/0001-fix-build-with-musl.patch | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 package/macchanger/0001-fix-build-with-musl.patch
package/macchanger/0001-fix-build-with-musl.patch new file +23 -0
new file mode 100644
index 0000000..e6f6db5
@@ -0,0 +1,23 @@
+Fix musl build
+
+Downloaded from:
+https://github.com/openwrt/packages/blob/master/utils/macchanger/patches/0001-fix-build-with-musl.patch
+
+Bug was already reported upstream:
+https://github.com/alobbs/macchanger/issues/14
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+
+Index: macchanger-1.7.0/src/netinfo.c
+===================================================================
+--- macchanger-1.7.0.orig/src/netinfo.c
++++ macchanger-1.7.0/src/netinfo.c
+@@ -113,7 +113,7 @@ mc_net_info_get_permanent_mac (const net
+ 	epa->size = IFHWADDRLEN;
+ 
+ 	memcpy(&req, &(net->dev), sizeof(struct ifreq));
+-	req.ifr_data = (caddr_t)epa;
++	req.ifr_data = (char *)epa;
+ 
+ 	if (ioctl(net->sock, SIOCETHTOOL, &req) < 0) {
+ 		perror ("[ERROR] Could not read permanent MAC");
Signature · 1 line
2.7.0.rc3
#1 lore raw

PATCH 1/1 package/macchanger: fix musl build

Hi,

Quoted 34 lines · Bernd Kuhls

Fixes
http://autobuild.buildroot.net/results/2bc/2bccf3fd7060870a337c0bd7a9
a750d0ad4e2c1c/
http://autobuild.buildroot.net/results/7d3/7d3f5bb036039b6966682eaf59
b8600849f27034/

---
?package/macchanger/0001-fix-build-with-musl.patch | 23
+++++++++++++++++++++++
?1 file changed, 23 insertions(+)
?create mode 100644 package/macchanger/0001-fix-build-with-musl.patch

package/macchanger/0001-fix-build-with-musl.patch new file +4 -0
new file mode 100644
index 0000000..e6f6db5
@@ -0,0 +1,23 @@
+Fix musl build
+
+Downloaded from:
+https://github.com/openwrt/packages/blob/master/utils/macchanger/pat

ches/0001-fix-build-with-musl.patch

package/macchanger/0001-fix-build-with-musl.patch new file +9 -0
+
+Bug was already reported upstream:
+https://github.com/alobbs/macchanger/issues/14
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+
+Index: macchanger-1.7.0/src/netinfo.c
+===================================================================
+--- macchanger-1.7.0.orig/src/netinfo.c

package/macchanger/0001-fix-build-with-musl.patch

Quoted 10 lines
package/macchanger/0001-fix-build-with-musl.patch new file +10 -0
++++ macchanger-1.7.0/src/netinfo.c
+@@ -113,7 +113,7 @@ mc_net_info_get_permanent_mac (const net
+?	epa->size = IFHWADDRLEN;
+?
+?	memcpy(&req, &(net->dev), sizeof(struct ifreq));
+-	req.ifr_data = (caddr_t)epa;
++	req.ifr_data = (char *)epa;
+?
+?	if (ioctl(net->sock, SIOCETHTOOL, &req) < 0) {
+?		perror ("[ERROR] Could not read permanent MAC");

any reason why this patch is marked as "Changes Requested"? The build error is still present...

Best regards
J?rg Krause

#2 lore raw

PATCH 1/1 package/macchanger: fix musl build

Quoted 3 lines · J?rg Krause

Hi,

On Sa, 2016-01-23 at 23:43 +0100, Bernd Kuhls wrote:

[snip]

Quoted 4 lines
Quoted 4 lines

+@@ -113,7 +113,7 @@ mc_net_info_get_permanent_mac (const net

package/macchanger/0001-fix-build-with-musl.patch new file +3 -0
+ 	epa->size = IFHWADDRLEN;
+
+ 	memcpy(&req, &(net->dev), sizeof(struct ifreq));
Quoted 8 lines

package/macchanger/0001-fix-build-with-musl.patch line 23

Quoted 5 lines

+- req.ifr_data = (caddr_t)epa;
++ req.ifr_data = (char *)epa;

package/macchanger/0001-fix-build-with-musl.patch new file +3 -0
+
+ 	if (ioctl(net->sock, SIOCETHTOOL, &req) < 0) {
+ 		perror ("[ERROR] Could not read permanent MAC");

any reason why this patch is marked as "Changes Requested"? The build error is still present...

IIRC, Bernd posted almost a hundred patches at the time for musl fixes, most
of which were taken from Alpine Linux, and almost all of which had insufficient explanation of the problem and of the fix (nothing more than "fix musl build" and a reference to the alpine patch). Also many of them were simply incorrect:
they would maybe fix the build, but possibly introducing other bugs or sometimes just breaking the code. So after reviewing and rejecting a dozen of them, ThomasP just made a generic comment that all of them should be done more carefully and marked all of them as Changes Requested.

If you would like to recover and review them, just select in patchwork patches
from Bernd that are marked as changes requested and that have musl in the subject. Feel free to repost (with better commit messages of course).

This one specifically does look good to me - except for the commit message,
which should be something like:

caddr_t is a BSD type. POSIX usually uses void* instead, but specifically in struct ifreq the type of ifr_data is char*.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH 1/1 package/macchanger: fix musl build

Dear Arnout,

Quoted 36 lines · Arnout Vandecappelle
Quoted 3 lines · J?rg Krause

Hi,

On Sa, 2016-01-23 at 23:43 +0100, Bernd Kuhls wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

+@@ -113,7 +113,7 @@ mc_net_info_get_permanent_mac (const net
+? epa->size = IFHWADDRLEN;
+
+? memcpy(&req, &(net->dev), sizeof(struct ifreq));
+- req.ifr_data = (caddr_t)epa;
++ req.ifr_data = (char *)epa;

Quoted 8 lines
Quoted 4 lines

+
+? if (ioctl(net->sock, SIOCETHTOOL, &req) < 0) {
+? perror ("[ERROR] Could not read permanent
MAC");

any reason why this patch is marked as "Changes Requested"? The build
error is still present...

? IIRC, Bernd posted almost a hundred patches at the time for musl fixes, most?
of which were taken from Alpine Linux, and almost all of which had insufficient?
explanation of the problem and of the fix (nothing more than "fix musl build"?
and a reference to the alpine patch). Also many of them were simply incorrect:?
they would maybe fix the build, but possibly introducing other bugs or sometimes?
just breaking the code. So after reviewing and rejecting a dozen of them,?
ThomasP just made a generic comment that all of them should be done more?
carefully and marked all of them as Changes Requested.

Quoted 5 lines

? If you would like to recover and review them, just select in patchwork patches?
from Bernd that are marked as changes requested and that have musl in the?
subject. Feel free to repost (with better commit messages of course).

I see! Yes, I will do this for some packages.

Quoted 8 lines

? This one specifically does look good to me - except for the commit message,?
which should be something like:

caddr_t is a BSD type. POSIX usually uses void* instead, but specifically in?
struct ifreq the type of ifr_data is char*.

Many thanks!

Best regards
J?rg Krause