summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2005-12-01 14:21:25 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2005-12-01 14:21:25 +0000
commit214e2000de8e57b8fcfa7489f53c7aaf5dc77cdd (patch)
treea0c906eed893d49f3110c7ebfc7dfead55a9af5d /src
parent9677653466a1fa1f0b72a004e1202f0d4684d86e (diff)
The code for finding all the local interface addresses on a FreeBSD
system running IPv6 was broken.
Diffstat (limited to 'src')
-rw-r--r--src/src/os.c11
-rw-r--r--src/src/version.c4
2 files changed, 8 insertions, 7 deletions
diff --git a/src/src/os.c b/src/src/os.c
index 8488fac0c..ff4d94940 100644
--- a/src/src/os.c
+++ b/src/src/os.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/os.c,v 1.3 2005/06/27 14:29:43 ph10 Exp $ */
+/* $Cambridge: exim/src/src/os.c,v 1.4 2005/12/01 14:21:25 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -661,8 +661,9 @@ for (cp = buf; cp < buf + ifc.V_ifc_len; cp += len)
if ((ifreq.V_ifr_flags & IFF_UP) == 0) continue;
/* On some operating systems we have to get the IP address of the interface
- by another call. On others, it's already there, but we must reinstate the
- data in ifreq, because SIOCGIFFLAGS may wreck it. */
+ by another call. On others, it's already there, but we must copy the full
+ length because we only copied the basic length above, and anyway,
+ GIFFLAGS may have wrecked the data. */
#ifndef SIOCGIFCONF_GIVES_ADDR
if (ioctl(vs, V_GIFADDR, (char *)&ifreq) < 0)
@@ -671,8 +672,8 @@ for (cp = buf; cp < buf + ifc.V_ifc_len; cp += len)
addrp = &ifreq.V_ifr_addr;
#else
- memcpy((char *)&ifreq, cp, sizeof(ifreq));
- memcpy(addrbuf, (char *)&(ifreq.V_ifr_addr), len - sizeof(ifreq.V_ifr_name));
+ memcpy(addrbuf, cp + offsetof(struct V_ifreq, V_ifr_addr),
+ len - sizeof(ifreq.V_ifr_name));
addrp = (struct sockaddr *)addrbuf;
#endif
diff --git a/src/src/version.c b/src/src/version.c
index 33bba46ab..4a07b0bc2 100644
--- a/src/src/version.c
+++ b/src/src/version.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/version.c,v 1.11 2005/10/12 15:45:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/version.c,v 1.12 2005/12/01 14:21:25 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -12,7 +12,7 @@
#include "exim.h"
-#define THIS_VERSION "4.60"
+#define THIS_VERSION "4.61"
/* The header file cnumber.h contains a single line containing the