diff mbox

librdmacm/mckey: enforce local binding for unmapped multicast addresses

Message ID Pine.LNX.4.64.0911011130140.6591@zuben.voltaire.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Or Gerlitz Nov. 1, 2009, 9:31 a.m. UTC
None
diff mbox

Patch

Index: librdmacm/examples/mckey.c
===================================================================
--- librdmacm.orig/examples/mckey.c
+++ librdmacm/examples/mckey.c
@@ -273,7 +273,7 @@  static int join_handler(struct cmatest_n
 	char buf[40];

 	inet_ntop(AF_INET6, param->ah_attr.grh.dgid.raw, buf, 40);
-	printf("mckey: joined dgid: %s\n", buf);
+	printf("mckey: joined dgid: %s mlid %x sl %d\n", buf, param->ah_attr.dlid, param->ah_attr.sl);

 	node->remote_qpn = param->qp_num;
 	node->remote_qkey = param->qkey;
@@ -556,6 +556,11 @@  int main(int argc, char **argv)
 		}
 	}

+	if (unmapped_addr && !src_addr) {
+		printf("unmapped multicast address requires binding to source address\n");
+		exit(1);
+	}
+
 	test.dst_addr = (struct sockaddr *) &test.dst_in;
 	test.connects_left = connections;