commit:     c5aea11f7b1333d61360069c45a8f6f6379c6dbd
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Sun Feb 16 18:27:28 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 17 01:50:35 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5aea11f

net-analyzer/iplog: Fix bad patch

Cast sockaddr_in* to sockaddr* unconditionally, it's always right thing
to do both in musl and in glibc context. Fixes build failure with gcc-14
without -stc=gnu23 passed to it.
Remove remains of fixes for -std=c23, gnu extensions are always enabled
in all contexts we care about.

Closes: https://bugs.gentoo.org/949571
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40599
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-analyzer/iplog/files/iplog-2.2.3-C23.patch | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/net-analyzer/iplog/files/iplog-2.2.3-C23.patch 
b/net-analyzer/iplog/files/iplog-2.2.3-C23.patch
index b905f0be4d9a..8552f4de932a 100644
--- a/net-analyzer/iplog/files/iplog-2.2.3-C23.patch
+++ b/net-analyzer/iplog/files/iplog-2.2.3-C23.patch
@@ -2,11 +2,10 @@ https://bugs.gentoo.org/945194 - guard bool for modern 
compilers
 https://bugs.gentoo.org/712644 - type aliaces for musl
 --- a/src/iplog.h
 +++ b/src/iplog.h
-@@ -21,6 +21,9 @@
+@@ -21,6 +21,8 @@
  #ifndef __IPLOG_H
  #define __IPLOG_H
  
-+#define _GNU_SOURCE 1
 +#include <sys/types.h> /* for u_* types */
 +
  #ifndef HAVE_IPADDR_T
@@ -22,15 +21,22 @@ https://bugs.gentoo.org/712644 - type aliaces for musl
  
  #ifdef HAVE_PATHS_H
  #     include <paths.h>
-C23 and GNU-15 compatibility, explicitly cast sockaddr
---- a/src/iplog_tcp.c
-+++ b/src/iplog_tcp.c
-@@ -144,7 +144,7 @@
+Explicitly cast sockaddr_in to sockaddr, always correct thing to do in this 
situation.
+--- a/src/iplog_tcp.c  2025-02-16 22:16:15.486203469 +0400
++++ b/src/iplog_tcp.c  2025-02-16 22:16:58.045309444 +0400
+@@ -142,14 +142,11 @@
+               fn_sin.sin_port = tcp->th_sport;
+               fn_sin.sin_addr.s_addr = ip->ip_src.s_addr;
  
                ret = sendto(raw_sock, (char *) xip,
                                sizeof(struct ip) + sizeof(struct tcphdr), 0,
 -#if !defined(__GLIBC__) || (__GLIBC__ < 2)
-+#if !defined(__GLIBC__) || (__GLIBC__ < 2) || (__STDC_VERSION__ > 201710L)
-                               (struct sockaddr *)
- #endif
-                               &fn_sin,
+-                              (struct sockaddr *)
+-#endif
+-                              &fn_sin,
++                              (struct sockaddr *)&fn_sin,
+                               sizeof(struct sockaddr_in));
+ 
+               if (ret == -1)
+                       IDEBUG(("[%s:%d] sendto: %s", __FILE__, __LINE__, 
strerror(errno)));
+ 

Reply via email to