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

[Cluster-devel] [PATCH] Make DLM source connections from known local address



Patch is against linux-cluster RHEL4 branch; resolves TCP routing
issues; Red Hat Bugzilla:

https://bugzilla.redhat.com/show_bug.cgi?id=338511

diff -ur dlm-kernel-2.6.9-46/src/lowcomms.c dlm-kernel-2.6.9-46-lhh/src/lowcomms.c
--- dlm-kernel-2.6.9-46/src/lowcomms.c	2007-10-25 17:05:03.000000000 -0400
+++ dlm-kernel-2.6.9-46-lhh/src/lowcomms.c	2007-10-25 17:07:10.000000000 -0400
@@ -555,6 +555,7 @@
 {
 	int result = -EHOSTUNREACH;
 	struct sockaddr_in6 saddr;
+	struct sockaddr_in6 my_addr;
 	int addr_len;
 	struct socket *sock;
 
@@ -585,6 +586,16 @@
 	sock->sk->sk_user_data = con;
 	con->rx_action = receive_from_sock;
 
+	/* Bind to local address before send */
+	memcpy(&my_addr, &local_addr, sizeof(my_addr));
+	make_sockaddr(&my_addr, 0, &addr_len);
+	result = sock->ops->bind(sock, (struct sockaddr *) &my_addr,
+				 (int) sizeof(my_addr));
+	if (result < 0) {
+		printk("dlm: could not bind for connect: %d\n", result);
+	}
+
+	/* Set up for connect */
 	make_sockaddr(&saddr, dlm_config.tcp_port, &addr_len);
 
 	add_sock(sock, con);

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