[netfilter-cvslog] r3585 - branches/netfilter-ha/linux-2.6/ct_sync

hidden at netfilter.org hidden at netfilter.org
Mon Jan 10 22:43:21 CET 2005


Author: hidden at netfilter.org
Date: 2005-01-10 22:43:21 +0100 (Mon, 10 Jan 2005)
New Revision: 3585

Modified:
   branches/netfilter-ha/linux-2.6/ct_sync/ct_sync_main.c
Log:
Revision: hidden at sch.bme.hu--2005-public/netfilter-ha--mainline--1.0--patch-10

Initialize notrack hook before protocol layer sends an IGMP packet.

* ct_sync/ct_sync_main.c (init_or_cleanup): initialize our notrack hook
  _before_ initializing the protocol layer and thus sending out an IGMP packet


Modified: branches/netfilter-ha/linux-2.6/ct_sync/ct_sync_main.c
===================================================================
--- branches/netfilter-ha/linux-2.6/ct_sync/ct_sync_main.c	2005-01-10 06:29:56 UTC (rev 3584)
+++ branches/netfilter-ha/linux-2.6/ct_sync/ct_sync_main.c	2005-01-10 21:43:21 UTC (rev 3585)
@@ -1768,21 +1768,11 @@
 		return -1;
 	}
 
-	/* init protocol layer */
-	cts_cfg.protoh = cts_proto_init(cts_cfg.devname, &cts_cfg.addr,
-					&ct_sync_state_transition, NULL,
-					&ct_sync_send_wait, &ct_sync_rcv_wait);
-	if (!cts_cfg.protoh) {
-		CT_SYNC_ERR("Failed to initialize protocol.\n");
-		ret = -EINVAL;
-		goto error_none;
-	}
-
 	/* Register hooks first, make sure not even the first sync packet gets
 	 * tracked */
 	if (notrack) {
 		if (nf_register_hook(&cts_hook_ops[0]) < 0)
-			goto error_proto;
+			goto error_none;
 		if (nf_register_hook(&cts_hook_ops[1]) < 0)
 			goto error_hook0;
 	} else {
@@ -1797,10 +1787,20 @@
 		ip_ct_selective_cleanup(kill_all, NULL);
 	}
 
+	/* init protocol layer */
+	cts_cfg.protoh = cts_proto_init(cts_cfg.devname, &cts_cfg.addr,
+					&ct_sync_state_transition, NULL,
+					&ct_sync_send_wait, &ct_sync_rcv_wait);
+	if (!cts_cfg.protoh) {
+		CT_SYNC_ERR("Failed to initialize protocol.\n");
+		ret = -EINVAL;
+		goto error_hook3;
+	}
+
 	/* register sysctl entries */
 	ct_sync_sysctl_header = register_sysctl_table(ct_sync_root_table, 0);
 	if (ct_sync_sysctl_header == NULL)
-		goto error_hook3;
+		goto error_proto;
 
 	/* register statistics */
 	ct_sync_stat = create_proc_entry("ct_sync", 0, proc_net_stat);
@@ -1865,6 +1865,8 @@
 error_sysctl:
 	CT_SYNC_DEBUG("removing sysctl entry\n");
 	unregister_sysctl_table(ct_sync_sysctl_header);
+error_proto:
+	cts_proto_cleanup(cts_cfg.protoh);
 error_hook3:
 	if (l2drop)
 		nf_unregister_hook(&cts_hook_ops[3]);
@@ -1877,8 +1879,6 @@
 error_hook0:
 	if (notrack)
 		nf_unregister_hook(&cts_hook_ops[0]);
-error_proto:
-	cts_proto_cleanup(cts_cfg.protoh);
 	/* make sure all conntrack timers are running */
 	ct_sync_start_timers();
 error_none:




More information about the netfilter-cvslog mailing list