[DRBD-cvs] svn commit by phil - r2579 - trunk/user - Removed the resending of netlink/connector messages, si

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Fri Nov 3 12:22:09 CET 2006


Author: phil
Date: 2006-11-03 12:22:09 +0100 (Fri, 03 Nov 2006)
New Revision: 2579

Modified:
   trunk/user/drbdsetup.c
Log:
Removed the resending of netlink/connector messages, since it seems that
there is no removal of duplicated messages on the receiving side.


Modified: trunk/user/drbdsetup.c
===================================================================
--- trunk/user/drbdsetup.c	2006-10-31 15:49:51 UTC (rev 2578)
+++ trunk/user/drbdsetup.c	2006-11-03 11:22:09 UTC (rev 2579)
@@ -123,8 +123,7 @@
 
 
 // Connector functions
-#define NL_TRIES 5
-#define NL_TIME 5000
+#define NL_TIME 10000
 int open_cn();
 int send_cn(int sk_nl, struct nlmsghdr* nl_hdr, int size);
 int receive_cn(int sk_nl, struct nlmsghdr* nl_hdr, int size, int timeout_ms);
@@ -1573,21 +1572,18 @@
 int call_drbd(int sk_nl, struct drbd_tag_list *tl, struct nlmsghdr* nl_hdr, 
 		     int size, int timeout_ms)
 {
-	int i,rr;
+	int rr;
 	prepare_nl_header(tl->nl_header, (char*)tl->tag_list_cpos - 
 			  (char*)tl->nl_header);
 
-	for(i=0;i<NL_TRIES;i++) {
-		rr = send(sk_nl,tl->nl_header,tl->nl_header->nlmsg_len,0);
-		if( rr != (ssize_t)tl->nl_header->nlmsg_len) {
-			perror("send() failed");
-			return -1;
-		}
-
-		rr = receive_reply_cn(sk_nl,tl,nl_hdr,size,timeout_ms/NL_TRIES);
-		if( rr == -2 ) continue; // timeout.
-		return rr;
+	rr = send(sk_nl,tl->nl_header,tl->nl_header->nlmsg_len,0);
+	if( rr != (ssize_t)tl->nl_header->nlmsg_len) {
+		perror("send() failed");
+		return -1;
 	}
+
+	rr = receive_reply_cn(sk_nl,tl,nl_hdr,size,timeout_ms);
+
 	if( rr == -2) {
 		fprintf(stderr,"No response from the DRBD driver!"
 			" Is the module loaded?\n");



More information about the drbd-cvs mailing list