Re: [Linux-cluster] Multicast for GFS?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It took some time... 

Attached is the patch for correcting cman_tool join into ipv4 mcast
group. 

Note to ipv6 developers / users: you may also need to set mcast ttl to
higher value via setsockopt() if you want to have cluster with network
traversing L3 devices, since linux default ttl is set for local scope
(ttl = 1), which would make first router drop the packet. 

-- 
Lazar Obradovic, System Engineer
----- 
laza@xxxxxx
YUnet International http://www.EUnet.yu
Dubrovacka 35/III, 11000 Belgrade
Tel: +381 11 3119901; Fax: +381 11 3119901
-----
This e-mail is confidential and intended only for the recipient.
Unauthorized distribution, modification or disclosure of its
contents is prohibited. If you have received this e-mail in error,
please notify the sender by telephone +381 11 3119901.
-----
--- cluster/cman/cman_tool/join.c       2004-07-23 09:48:16.000000000 +0200
+++ new-cluster/cman/cman_tool/join.c   2004-08-06 05:59:20.353829392 +0200
@@ -118,13 +118,22 @@
        die("Cannot bind multicast address: %s", strerror(errno));

     /* Join the multicast group */
-    if (!bcast) {
+    if (bhe) {
        struct ip_mreq mreq;
+       u_char mcast_opt;

        memcpy(&mreq.imr_multiaddr, bhe->h_addr, bhe->h_length);
-       memcpy(&mreq.imr_interface, he->h_addr, he->h_length);
+       mreq.imr_interface.s_addr = htonl(INADDR_ANY);
        if (setsockopt(mcast_sock, SOL_IP, IP_ADD_MEMBERSHIP, (void *)&mreq, sizeof(mreq)))
            die("Unable to join multicast group %s: %s\n", comline->multicast_names[num], strerror(errno));
+
+       mcast_opt = 10;
+       if (setsockopt(mcast_sock, SOL_IP, IP_MULTICAST_TTL, (void *)&mcast_opt, sizeof(mcast_opt)))
+           die("Unable to set ttl for multicast group %s: %s\n", comline->multicast_names[num], strerror(errno));
+
+       mcast_opt = 0;
+       setsockopt(mcast_sock, SOL_IP, IP_MULTICAST_LOOP, (void *)&mcast_opt, sizeof(mcast_opt))
+
     }

     /* Local socket */

[Index of Archives]     [Corosync Cluster Engine]     [GFS]     [Linux Virtualization]     [Centos Virtualization]     [Centos]     [Linux RAID]     [Fedora Users]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Camping]

  Powered by Linux