[netfilter-cvslog] r3798 - branches/netfilter-ha/linux-2.6-actact/ct_sync

laforge at netfilter.org laforge at netfilter.org
Thu Mar 17 12:25:09 CET 2005


Author: laforge at netfilter.org
Date: 2005-03-17 12:25:08 +0100 (Thu, 17 Mar 2005)
New Revision: 3798

Modified:
   branches/netfilter-ha/linux-2.6-actact/ct_sync/ct_sync_proto.c
Log:
cosmetic cleanup, send recovery request via unicast


Modified: branches/netfilter-ha/linux-2.6-actact/ct_sync/ct_sync_proto.c
===================================================================
--- branches/netfilter-ha/linux-2.6-actact/ct_sync/ct_sync_proto.c	2005-03-17 11:24:34 UTC (rev 3797)
+++ branches/netfilter-ha/linux-2.6-actact/ct_sync/ct_sync_proto.c	2005-03-17 11:25:08 UTC (rev 3798)
@@ -828,7 +828,8 @@
 	/* check seqno of csr->backlog */
 	if (cts_seqno_cmp(bseq, (u16)((seq + 1) & 0xffff)) > 0) {
 		/* give up and request initsync */
-		CT_SYNC_DEBUG("recovery impossible: backlog begins at %d\n", bseq);
+		CT_SYNC_DEBUG("recovery impossible: backlog begins at %d\n",
+				bseq);
 		spin_unlock_bh(&csr->lock);
 		CT_SYNC_LEAVE();
 		return -1;
@@ -905,7 +906,8 @@
  * request recovery, last seen packet is seq
  */
 static int
-cts_proto_request_recovery(struct cts_protoh *cph, u16 seq, int diff)
+cts_proto_request_recovery(struct cts_protoh *cph, u16 seq, int diff,
+			   struct sockaddr_storage *ss)
 {
 	struct ct_sync_pkthdr hdr;
 	ssize_t len;
@@ -915,8 +917,10 @@
 	/* check if we already have a pending request */
 	if (atomic_read(&cph->recovery_request.active)) {
 		/* if there are at least recovery_threshold lost messages
-		 * since the last request, repeat; return immediately otherwise */
-		if (diff < cph->recovery_request.diff + cts_proto_recovery_threshold) {
+		 * since the last request, repeat; otherwise return 
+		 * immediately */
+		if (diff < cph->recovery_request.diff +
+				cts_proto_recovery_threshold) {
 			CT_SYNC_LEAVE();
 			return 0;
 		}
@@ -931,7 +935,7 @@
 
 	len = cts_sock_sendto(cph->send.socket, (char *)&hdr, 
 			      sizeof(struct ct_sync_pkthdr),
-			      NULL, 0);
+			      (struct sockaddr *)ss, sizeof(*ss));
 	if (unlikely(len < sizeof(struct ct_sync_pkthdr))) {
 		CT_SYNC_ERR("Send failed, returned %d.\n", len);
 		CT_SYNC_LEAVE();
@@ -946,9 +950,10 @@
 /* 
  * Check if a pending recovery request is fulfilled when 'seq' is received
  *
- * We consider a pending request fulfilled, if seq >= request.seq + request.diff.
- * This means that we have to successfully receive the packet which caused
- * the request to be sent.
+ * We consider a pending request fulfilled, if 
+ * 	seq >= request.seq + request.diff.  
+ * This means that we have to successfully receive the packet which caused the
+ * request to be sent.
  *
  * Returns:
  *   0 if there were no pending recovery requests
@@ -1089,7 +1094,7 @@
 			if (sdiff > 0) {
 				/* we have lost some packages, try to recover */
 				cts_proto_request_recovery(cph, csr->seqno, 
-							   sdiff);
+							   sdiff, &csb->addr);
 			} else {
 				/* we've already seen this, let's drop it */
 				CT_SYNC_DEBUG("dropping duplicate, diff %d\n", 




More information about the netfilter-cvslog mailing list