[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sockaddr patch to compile current Zmailer for FreeBSD/OpenBSD



On Tue, Nov 14, 2000 at 06:09:00PM +0300, Andrew P. Kokarev wrote:
> I had to apply the following patch to compile the last few releases 
> and current CVS Zmailer for both FreeBSD 4.2-BETA and OpenBSD 2.7.
> Otherwise I'm getting "structure has no member sa" messages from cc. 

  I made zmailer-2.99.54-patch1 just some minutes before this email
  arrived...  Shall I redo the tagged diff, or do additional increment ?

  Actually I think this applies also to that 2.99.54-patch1  as is.

  However *if* you have IPv6 support, then couple other things must be
  patched in similar manner in those same files.

  Anyway, I am positively surprised that my never tested code at least
  compiles at your machine, but does it also work ?

  Could you do:
	$ cd lib
	$ make selfaddrs-test
	$ ./selfaddrs-test
  and see that it really prints all IPv4 (and IPv6) interface addresses
  currently in use at your system ?


> diff -ru zmailer.dist/lib/selfaddrs.c zmailer/lib/selfaddrs.c
> --- zmailer.dist/lib/selfaddrs.c	Sun Nov 12 20:04:19 2000
> +++ zmailer/lib/selfaddrs.c	Tue Nov 14 16:30:51 2000
> @@ -142,7 +142,7 @@
>  		return -5; /* UAARGH! */
>  	      }
>  
> -	      if (sa->sa.sa_family == AF_INET) {
> +	      if (sa->sa_family == AF_INET) {
>  		struct sockaddr_in *si4 = (void*)malloc(sizeof(*si4));
>  		if (si4 == NULL)
>  		  break;
> diff -ru zmailer.dist/lib/zgetifaddress.c zmailer/lib/zgetifaddress.c
> --- zmailer.dist/lib/zgetifaddress.c	Sun Nov 12 20:04:19 2000
> +++ zmailer/lib/zgetifaddress.c	Tue Nov 14 16:31:26 2000
> @@ -121,10 +121,10 @@
>  
>  	      /* We have matching name, do we have matching AF ?? */
>  
> -	      if (sa->sa.sa_family != af)
> +	      if (sa->sa_family != af)
>  		continue; /* Nope.. */
>  
> -	      if (sa->sa.sa_family == AF_INET) {
> +	      if (sa->sa_family == AF_INET) {
>  		struct sockaddr_in *si4 = (void*)sap;
>  
>  		if (si4 == NULL) break; /* Bad param! */
> 

-- 
/Matti Aarnio	<mea@nic.funet.fi>