apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: svn commit: r1733451 - in /apr/apr/trunk: include/apr_network_io.h network_io/unix/sockopt.c test/testsock.c
Date Thu, 03 Mar 2016 15:24:07 GMT
On Thu, Mar 3, 2016 at 1:00 PM,  <jorton@apache.org> wrote:
> Author: jorton
> Date: Thu Mar  3 12:00:20 2016
> New Revision: 1733451
>
> URL: http://svn.apache.org/viewvc?rev=1733451&view=rev
> Log:
> * include/apr_network_io.h (APR_SO_FREEBIND): Add option.
>
> * network_io/unix/sockopt.c (apr_socket_opt_set): Implement
>   APR_SO_FREEBIND on Linux with IP_FREEBIND
>
[]
>
> Modified: apr/apr/trunk/network_io/unix/sockopt.c
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockopt.c?rev=1733451&r1=1733450&r2=1733451&view=diff
> ==============================================================================
> --- apr/apr/trunk/network_io/unix/sockopt.c (original)
> +++ apr/apr/trunk/network_io/unix/sockopt.c Thu Mar  3 12:00:20 2016
> @@ -330,6 +330,20 @@ apr_status_t apr_socket_opt_set(apr_sock
>          return APR_ENOTIMPL;
>  #endif
>          break;
> +    case APR_SO_FREEBIND:
> +#if defined(IP_FREEBIND)
> +        if (setsockopt(sock->socketdes, SOL_IP, IP_FREEBIND,
> +                       (void *)&one, sizeof(int)) == -1) {
> +            return errno;
> +        }
> +        apr_set_option(sock, APR_SO_FREEBIND, on);
> +#elif defined(IP_BINDANY)
> +        /* TODO: insert FreeBSD support here, note family specific
> +         * options, IP_BINDANY vs IPV6_BINDANY */

Don't we want to return APR_ENOTIMPL here until the FreeBSD implementation?

> +#else
> +        return APR_ENOTIMPL;
> +#endif
> +        break;
>      default:
>          return APR_EINVAL;
>      }

Regards,
Yann.

Mime
View raw message