Hi Nicolas (and everyone),

In message <[EMAIL PROTECTED]>, David Wood 
<[EMAIL PROTECTED]> writes
>In message <[EMAIL PROTECTED]>, David Wood
><[EMAIL PROTECTED]> writes
>>For future robustness, rather than a version number check (it's just
>>possible that FreeBSD 5.x will get a working gethostbyaddr_r(), much as
>>I doubt it), here's an alternative patch to that in bug #454, using
>><http://lists.cistron.nl/pipermail/freeradius-users/2003-October/024297.html>
>>as my inspiration:
>
>Not only is that patch ugly - further testing proves that it's flawed.
>
>I'll have another go at it tomorrow.

It didn't take until tomorrow - this looks better, and is tested and 
apparently working with autoconf 2.61.


Note - this patch is against 2.0.0-pre1, not CVS HEAD.

--- BEGIN ---
--- configure.in        Tue May 29 04:58:50 2007
+++ configure.in        Tue May 29 04:57:03 2007
@@ -904,9 +904,17 @@
  AC_MSG_CHECKING([gethostbyaddr_r() syntax])
  case "$host" in
  *-freebsd*)
-       AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r 
functions ])
-       gethostbyaddrrstyle=BSD
-       AC_MSG_WARN([FreeBSD overridden to BSD-style])
+dnl With FreeBSD, check if there's a prototype for gethostbyaddr_r.
+dnl Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we 
override this test to
+dnl BSDSTYLE. FreeBSD 6.2 and up have proper GNU style support.
+       AC_CHECK_DECLS([gethostbyaddr_r], [], [
+               AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of 
gethostbyaddr_r functions ])
+               gethostbyaddrrstyle=BSD
+               AC_MSG_WARN([FreeBSD overridden to BSD-style])
+       ], [
+#include <stdio.h>
+#include <netdb.h>
+])
         ;;
  esac
  if test "x$gethostbyaddrrstyle" = "x"; then
--- END ---

(with apologies once again about the lost tabs - a plain/text MIME 
attachment might keep them, but cut and paste means a tab is turned into 
8 spaces in my mailer)


As a check on functionality, I temporarily changed the name of the 
function in the first parameter of AC_CHECK_DECLS to garbage, which 
changed the behaviour of the code as I'd intended (verified by diffing 
config.log between the 'garbage'' and normal runs).

What do you think? Do you agree that that's a better solution than the 
patch in bug #454?


Meanwhile, I think I've fixed the packaging list for the FreeRADIUS 2 
port on FreeBSD (and the script that generates it) - though this process 
did flag up one oddity. src/modules/rlm_eap/types/rlm_eap_psk is not 
built in 2.0.0-pre1. So far as I can tell, this is because Makefile.in 
is never turned into a Makefile. Is this intentional?

I'll continue to test as I find the time over the next few days - I need 
to port my configuration to FreeRADIUS 2.x, as well as check my port 
carefully.


Best wishes,




David
-- 
David Wood
[EMAIL PROTECTED]
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to