[Olsr-dev] [PATCH] olsrd Fix listen on ip6 only in jsoninfo

Patrick (spam-protected)
Thu Jul 10 00:25:41 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I cant start 2 process of olsrd with ip6 and ip4.
The ip6 process is listen on ip4 tcp port 9090.

I'm not sure if this the right places to do this.

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 */
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlO9wWUACgkQr9m0OkMZoqStSACgwfGiZLiOiCI5kPYQDqdfX+Jf
dGEAoOsOrA4jUx/SzfXC+qs+9DZJgrzc
=6lKr
-----END PGP SIGNATURE-----




More information about the Olsr-dev mailing list