innfeed/host.c fix?

Ivan Shmakov oneingray at gmail.com
Sun May 18 06:30:58 UTC 2008


>>>>> "JTH" == J T Halliley <J.T.Halliley at flagstar.com> writes:

 > I configured inn with --disable-ipv6, but when I did a make, I got
 > errors regarding AF_INET6 being undefined.  So it seems that, in
 > host.c,

 > Lines 1337-1349:

 >   fprintf (fp,"%s    peer-name : %s\n",indent,host->params->peerName) ;
 >   fprintf (fp,"%s    ip-name : %s\n",indent,host->params->ipName) ;
 >   if (host->params->family == AF_INET6)
 >     {
 >       fprintf (fp,"%s    bindaddress : none\n",indent);
 >     }
 >   else
 >     {
 >       fprintf (fp,"%s    bindaddress : %s\n",indent,
 >       host->params->bindAddr == NULL ||
 >       host->params->bindAddr->sin_addr.s_addr == 0 ? "any" :
 >         inet_ntoa(host->params->bindAddr->sin_addr));
 >     }

 > should probably be:

 >   fprintf (fp,"%s    peer-name : %s\n",indent,host->params->peerName) ;
 >   fprintf (fp,"%s    ip-name : %s\n",indent,host->params->ipName) ;
 > #ifdef HAVE_INET6
 >   if (host->params->family == AF_INET6)
 >     {
 >       fprintf (fp,"%s    bindaddress : none\n",indent);
 >     }
 >   else
 >     {
 > #endif
 >       fprintf (fp,"%s    bindaddress : %s\n",indent,
 >       host->params->bindAddr == NULL ||
 >       host->params->bindAddr->sin_addr.s_addr == 0 ? "any" :
 >         inet_ntoa(host->params->bindAddr->sin_addr));
 > #ifdef HAVE_INET6
 >     }
 > #endif

	BTW, there's no reason to avoid a block here, it may as well be
	written as just, e. g.:

     fprintf (fp,"%s    peer-name : %s\n",indent,host->params->peerName) ;
     fprintf (fp,"%s    ip-name : %s\n",indent,host->params->ipName) ;
   #ifdef HAVE_INET6
     if (host->params->family == AF_INET6)
       {
         fprintf (fp,"%s    bindaddress : none\n",indent);
       }
     else
   #endif
       {
         fprintf (fp,"%s    bindaddress : %s\n",indent,
         host->params->bindAddr == NULL ||
         host->params->bindAddr->sin_addr.s_addr == 0 ? "any" :
           inet_ntoa(host->params->bindAddr->sin_addr));
       }

 > or at least when I added these ifdefs the code compiled cleanly.
 > Is this a correct fix?

	It looks good to me, but I'm not familiar with this part of the
	code at all.



More information about the inn-workers mailing list