exim-1.62 PATCH glibc

Top Page
Delete this message
Reply to this message
Author: neal
Date:  
To: exim-users
Subject: exim-1.62 PATCH glibc
Here is the patch I used to build exim-1.62 on Linux with glibc-2.0.4.

I had to guess a bit on what to do with ip_option stuff. Hopefully I
guess correctly.

Yes, Linux now has a new c library, and it has chosen yet another
incompatible format for ip_options. Don't ask me why.

ALSO: you need to add -lresolv -lnsl to link!

--- ./src/smtp_in.c    1997/08/16 15:11:39    1.1
+++ ./src/smtp_in.c    1997/08/16 15:05:11
@@ -584,9 +584,15 @@
     if (log_ip_options || kill_ip_options || refuse_ip_options)
       {
       #ifdef LINUX_IP_OPTIONS
+      #if (__GLIBC__ < 2)
       int optlen = sizeof(struct ip_options) + MAX_IPOPTLEN;
       struct ip_options *ipopt = store_malloc(optlen);
       #else
+      struct ip_opts ipoptblock;
+      struct ip_opts *ipopt = &ipoptblock;
+      int optlen = sizeof(ipoptblock);
+      #endif
+      #else
       struct ipoption ipoptblock;
       struct ipoption *ipopt = &ipoptblock;
       int optlen = sizeof(ipoptblock);
@@ -616,7 +622,11 @@
           struct in_addr addr;


           #ifdef LINUX_IP_OPTIONS
+      #if (__GLIBC__ < 2)
           unsigned char *optstart = (unsigned char *)(ipopt->__data);
+      #else
+      unsigned char *optstart = (unsigned char *)(ipopt->ip_opts);
+      #endif
           #else
           unsigned char *optstart = (unsigned char *)(ipopt->ipopt_list);
           #endif
@@ -641,7 +651,11 @@
           case IPOPT_LSRR:
               sprintf(p, " %s [@%s", (*opt == IPOPT_SSRR)? "SSRR" : "LSRR",
               #ifdef LINUX_IP_OPTIONS
+          #if (__GLIBC__ < 2)
                 inet_ntoa(*((struct in_addr *)(&(ipopt->faddr)))));
+          #else
+            inet_ntoa(ipopt->ip_dst));
+          #endif
               #else
                 inet_ntoa(ipopt->ipopt_dst));
               #endif
--- ./build-Linux-i386/libident/ident.h    1997/08/16 03:20:25    1.1
+++ ./build-Linux-i386/libident/ident.h    1997/08/16 03:21:54
@@ -113,7 +113,7 @@
 #  define __STRUCT_IN_ADDR_P    struct in_addr *
 #endif


-#if defined(__GNUC__) && !defined(DST_NONE)
+#if defined(__GNUC__) && (__GNUC__ < 2) && !defined(DST_NONE)
 #  define __STRUCT_TIMEVAL_P    void *
 #else
 #  define __STRUCT_TIMEVAL_P    struct timeval *