tcp_wrappers: update patches for gcc14
authorMatthew Cather <[email protected]>
Tue, 13 May 2025 18:07:16 +0000 (13:07 -0500)
committerRobert Marko <[email protected]>
Sun, 18 May 2025 08:55:38 +0000 (10:55 +0200)
The portable way is to use `socklen_t`. This fixes both glibc and
musl based builds.

Signed-off-by: Matthew Cather <[email protected]>
libs/tcp_wrappers/patches/001-debian_subset.patch
libs/tcp_wrappers/patches/006-compilation-warnings.patch

index 7d22cb09f89d9a107ba614ef04c1b543c18a9a59..5e144c0767edb7eeafd5dc7a6bb2e56702b0b121 100644 (file)
  #endif
 --- a/fix_options.c
 +++ b/fix_options.c
-@@ -35,7 +35,12 @@ struct request_info *request;
+@@ -35,7 +35,8 @@ struct request_info *request;
  #ifdef IP_OPTIONS
      unsigned char optbuf[BUFFER_SIZE / 3], *cp;
      char    lbuf[BUFFER_SIZE], *lp;
-+#if !defined(__GLIBC__)
-     int     optsize = sizeof(optbuf), ipproto;
-+#else /* __GLIBC__ */
-+    size_t  optsize = sizeof(optbuf);
+-    int     optsize = sizeof(optbuf), ipproto;
++    socklen_t  optsize = sizeof(optbuf);
 +    int     ipproto;
-+#endif /* __GLIBC__ */
      struct protoent *ip;
      int     fd = request->fd;
      unsigned int opt;
      struct sockaddr_in *sin = (struct sockaddr_in *) sa;
 --- a/socket.c
 +++ b/socket.c
-@@ -76,7 +76,11 @@ struct request_info *request;
+@@ -76,7 +76,7 @@ struct request_info *request;
  {
      static struct sockaddr_in client;
      static struct sockaddr_in server;
-+#if !defined (__GLIBC__)
-     int     len;
-+#else /* __GLIBC__ */
-+    size_t  len;
-+#endif /* __GLIBC__ */
+-    int     len;
++    socklen_t  len;
      char    buf[BUFSIZ];
      int     fd = request->fd;
  
-@@ -224,7 +228,11 @@ int     fd;
+@@ -224,7 +224,7 @@ int     fd;
  {
      char    buf[BUFSIZ];
      struct sockaddr_in sin;
-+#if !defined(__GLIBC__)
-     int     size = sizeof(sin);
-+#else /* __GLIBC__ */
-+    size_t  size = sizeof(sin);
-+#endif /* __GLIBC__ */
+-    int     size = sizeof(sin);
++    socklen_t  size = sizeof(sin);
  
      /*
       * Eat up the not-yet received datagram. Some systems insist on a
index 57a4e7c1c8202348ebec56de450fcecf98971fe9..5dbf97257d30ced229ef33e9b2bba891e285acb0 100644 (file)
  #endif
  
  #include <sys/types.h>
-@@ -29,14 +29,14 @@ static char sccsid[] = "@(#) fix_options
+@@ -29,7 +29,7 @@ static char sccsid[] = "@(#) fix_options
  
  /* fix_options - get rid of IP-level socket options */
  
 -fix_options(request)
--struct request_info *request;
-+void    fix_options(request)
-+struct  request_info *request;
++void fix_options(request)
+ struct request_info *request;
  {
  #ifdef IP_OPTIONS
-     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
-     char    lbuf[BUFFER_SIZE], *lp;
- #if !defined(__GLIBC__)
--    int     optsize = sizeof(optbuf), ipproto;
-+    unsigned int  optsize = sizeof(optbuf), ipproto;
- #else /* __GLIBC__ */
-     size_t  optsize = sizeof(optbuf);
-     int     ipproto;
 --- a/fromhost.c
 +++ b/fromhost.c
 @@ -11,7 +11,7 @@
  #endif
  
  /* System libraries. */
-@@ -77,7 +77,7 @@ struct request_info *request;
-     static struct sockaddr_in client;
-     static struct sockaddr_in server;
- #if !defined (__GLIBC__)
--    int     len;
-+    unsigned int  len;
- #else /* __GLIBC__ */
-     size_t  len;
- #endif /* __GLIBC__ */
-@@ -229,7 +229,7 @@ int     fd;
-     char    buf[BUFSIZ];
-     struct sockaddr_in sin;
- #if !defined(__GLIBC__)
--    int     size = sizeof(sin);
-+    unsigned int  size = sizeof(sin);
- #else /* __GLIBC__ */
-     size_t  size = sizeof(sin);
- #endif /* __GLIBC__ */
 --- a/tcpd.c
 +++ b/tcpd.c
 @@ -11,7 +11,7 @@