($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [meta-oe][PATCH] libndp: Fix build with gcc-14/musl
Date: Sat, 18 May 2024 10:48:59 -0700	[thread overview]
Message-ID: <20240518174859.2644879-1-raj.khem@gmail.com> (raw)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...1-libndp-Fix-signature-of-sendto-API.patch | 40 +++++++++++++++++++
 .../recipes-connectivity/libndp/libndp_1.8.bb |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta-oe/recipes-connectivity/libndp/libndp/0001-libndp-Fix-signature-of-sendto-API.patch

diff --git a/meta-oe/recipes-connectivity/libndp/libndp/0001-libndp-Fix-signature-of-sendto-API.patch b/meta-oe/recipes-connectivity/libndp/libndp/0001-libndp-Fix-signature-of-sendto-API.patch
new file mode 100644
index 0000000000..f625416acf
--- /dev/null
+++ b/meta-oe/recipes-connectivity/libndp/libndp/0001-libndp-Fix-signature-of-sendto-API.patch
@@ -0,0 +1,40 @@
+From 14e036b5daf6b72483a1a21054b5133acabceabe Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 17 May 2024 18:14:04 -0700
+Subject: [PATCH] libndp: Fix signature of sendto API
+
+This fixes build with musl/gcc-14
+
+| ../../git/libndp/libndp.c: In function 'mysendto6':
+| ../../git/libndp/libndp.c:212:50: error: passing argument 5 of 'sendto' from incompatible pointer type [-Wincompatible-pointer-types]
+|   212 |         ret = sendto(sockfd, buf, buflen, flags, &sin6, sizeof(sin6));
+|       |                                                  ^~~~~
+|       |                                                  |
+|       |                                                  struct sockaddr_in6 *
+| In file included from ../../git/libndp/libndp.c:27:
+| /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libndp/1.8/recipe-sysroot/usr/include/sys/socket.h:396:49: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_in6 *'
+|   396 | ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
+|       |                                                 ^~~~~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Submitted [Sent to maintainer]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libndp/libndp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libndp/libndp.c b/libndp/libndp.c
+index 6314717..056df0f 100644
+--- a/libndp/libndp.c
++++ b/libndp/libndp.c
+@@ -209,7 +209,7 @@ static int mysendto6(int sockfd, void *buf, size_t buflen, int flags,
+ 	memcpy(&sin6.sin6_addr, addr, sizeof(sin6.sin6_addr));
+ 	sin6.sin6_scope_id = ifindex;
+ resend:
+-	ret = sendto(sockfd, buf, buflen, flags, &sin6, sizeof(sin6));
++	ret = sendto(sockfd, buf, buflen, flags, (struct sockaddr*)&sin6, sizeof(sin6));
+ 	if (ret == -1) {
+ 		switch(errno) {
+ 		case EINTR:
+-- 
+2.45.1
+
diff --git a/meta-oe/recipes-connectivity/libndp/libndp_1.8.bb b/meta-oe/recipes-connectivity/libndp/libndp_1.8.bb
index 4d4d3e51cd..80946317e4 100644
--- a/meta-oe/recipes-connectivity/libndp/libndp_1.8.bb
+++ b/meta-oe/recipes-connectivity/libndp/libndp_1.8.bb
@@ -4,6 +4,7 @@ LICENSE = "LGPL-2.1-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 
 SRC_URI = "git://github.com/jpirko/libndp;branch=master;protocol=https \
+           file://0001-libndp-Fix-signature-of-sendto-API.patch \
            "
 # tag for v1.8
 SRCREV = "009ce9cd9b950ffa1f4f94c9436027b936850d0c"
-- 
2.45.1



                 reply	other threads:[~2024-05-18 17:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240518174859.2644879-1-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).