[Ocfs2-commits] smushran commits r2778 - branches/ocfs2-1.2/fs/ocfs2/cluster

svn-commits@oss.oracle.com svn-commits at oss.oracle.com
Tue Feb 28 18:14:45 CST 2006


Author: smushran
Signed-off-by: zab
Date: 2006-02-28 18:14:44 -0600 (Tue, 28 Feb 2006)
New Revision: 2778

Modified:
   branches/ocfs2-1.2/fs/ocfs2/cluster/tcp.c
Log:
fix for bugzilla#678
added source addr to bind() in o2net_start_connect() to prevent
confusion if one specifies a vip on the same interface
Signed-off-by: zab

Modified: branches/ocfs2-1.2/fs/ocfs2/cluster/tcp.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/cluster/tcp.c	2006-02-23 21:52:35 UTC (rev 2777)
+++ branches/ocfs2-1.2/fs/ocfs2/cluster/tcp.c	2006-03-01 00:14:44 UTC (rev 2778)
@@ -1342,7 +1342,7 @@
 {
 	struct o2net_node *nn = arg;
 	struct o2net_sock_container *sc = NULL;
-	struct o2nm_node *node = NULL;
+	struct o2nm_node *node = NULL, *mynode = NULL;
 	struct socket *sock = NULL;
 	struct sockaddr_in myaddr = {0, }, remoteaddr = {0, };
 	int ret = 0;
@@ -1358,6 +1358,12 @@
 		goto out;
 	}
 
+	mynode = o2nm_get_node_by_num(o2nm_this_node());
+	if (mynode == NULL) {
+		ret = 0;
+		goto out;
+	}
+
 	spin_lock(&nn->nn_lock);
 	/* see if we already have one pending or have given up */
 	if (nn->nn_sc || nn->nn_persistent_error)
@@ -1385,12 +1391,14 @@
 	sock->sk->sk_allocation = GFP_ATOMIC;
 
 	myaddr.sin_family = AF_INET;
+	myaddr.sin_addr.s_addr = (__force u32)mynode->nd_ipv4_address;
 	myaddr.sin_port = (__force u16)htons(0); /* any port */
 
 	ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr,
 			      sizeof(myaddr));
 	if (ret) {
-		mlog(0, "bind failed: %d\n", ret);
+		mlog(ML_ERROR, "bind failed with %d at address %u.%u.%u.%u\n",
+		     ret, NIPQUAD(mynode->nd_ipv4_address));
 		goto out;
 	}
 
@@ -1431,6 +1439,8 @@
 		sc_put(sc);
 	if (node)
 		o2nm_node_put(node);
+	if (mynode)
+		o2nm_node_put(mynode);
 
 	return;
 }




More information about the Ocfs2-commits mailing list