[conntrack-tools] sync-mode: change current link if message is correct

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Fri Feb 20 20:24:44 CET 2009


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=2112bbdb99a57704ec882ee0926a11c548501f0d
commit 2112bbdb99a57704ec882ee0926a11c548501f0d
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Fri Feb 20 20:24:00 2009 +0100
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Fri Feb 20 20:24:00 2009 +0100

    sync-mode: change current link if message is correct
    
    This patch makes conntrackd change the current dedicated link if
    the message is correct, ie. neither malformed nor out-of-sync.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
       via  2112bbdb99a57704ec882ee0926a11c548501f0d (commit)
      from  1c8002a2de8cfc2ff9d624099d5154bcd77e2f37 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2112bbdb99a57704ec882ee0926a11c548501f0d
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Fri Feb 20 20:24:00 2009 +0100

    sync-mode: change current link if message is correct
    
    This patch makes conntrackd change the current dedicated link if
    the message is correct, ie. neither malformed nor out-of-sync.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

-----------------------------------------------------------------------

 src/sync-mode.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
This patch makes conntrackd change the current dedicated link if
the message is correct, ie. neither malformed nor out-of-sync.

Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

diff --git a/src/sync-mode.c b/src/sync-mode.c
index 866b313..02a5a46 100644
--- a/src/sync-mode.c
+++ b/src/sync-mode.c
@@ -36,6 +36,13 @@
 #include <net/if.h>
 
 static void
+mcast_change_current_link(int if_idx)
+{
+	if (if_idx != mcast_get_current_ifidx(STATE_SYNC(mcast_client)))
+		mcast_set_current_link(STATE_SYNC(mcast_client), if_idx);
+}
+
+static void
 do_mcast_handler_step(int if_idx, struct nethdr *net, size_t remain)
 {
 	char __ct[nfct_maxsize()];
@@ -49,14 +56,14 @@ do_mcast_handler_step(int if_idx, struct nethdr *net, size_t remain)
 		return;
 	}
 
-	if (if_idx != mcast_get_current_ifidx(STATE_SYNC(mcast_client)))
-		mcast_set_current_link(STATE_SYNC(mcast_client), if_idx);
-
 	switch (STATE_SYNC(sync)->recv(net)) {
 		case MSG_DATA:
+			mcast_change_current_link(if_idx);
 			break;
 		case MSG_DROP:
+			return;
 		case MSG_CTL:
+			mcast_change_current_link(if_idx);
 			return;
 		case MSG_BAD:
 			STATE_SYNC(error).msg_rcv_malformed++;



More information about the netfilter-cvslog mailing list