[Olsr-dev] [PATCH 1/2] fix jsoninfo too listen on ipv6 port only

Ferry Huberts (spam-protected)
Thu Jul 10 18:59:26 CEST 2014


Thanks, series is applied on master (with slightly modified comments)

On 10/07/14 18:41, Patrick Grimm wrote:
> If not IPV6_V6ONLY flag ist set then olsrd with ipversion=6
> is listen on IPv6 and IPv4 tcp port. A second process with
> ipversion=4 can’t listen on IPv4 tcp Port.
>
> Signed-off-by: Patrick Grimm <(spam-protected)>
> ---
>   lib/jsoninfo/src/olsrd_jsoninfo.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/lib/jsoninfo/src/olsrd_jsoninfo.c b/lib/jsoninfo/src/olsrd_jsoninfo.c
> index d86fa88..0db7609 100644
> --- a/lib/jsoninfo/src/olsrd_jsoninfo.c
> +++ b/lib/jsoninfo/src/olsrd_jsoninfo.c
> @@ -385,6 +385,14 @@ plugin_ipc_init(void)
>         return 0;
>       }
>   #endif /* (defined __FreeBSD__ || defined __FreeBSD_kernel__) && defined SO_NOSIGPIPE */
> +#if defined linux
> +    if (olsr_cnf->ip_version == AF_INET6) {
> +      if (setsockopt(ipc_socket, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&yes, sizeof(yes)) < 0) {
> +        perror("IPV6_V6ONLY failed");
> +        return 0;
> +      }
> +    }
> +#endif /* defined linux */
>       /* Bind the socket */
>
>       /* complete the socket structure */
>

-- 
Ferry Huberts




More information about the Olsr-dev mailing list