[conntrack-tools] sync-mode: rename mcast_iface structure to interface

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Mon Mar 9 11:38:40 CET 2009


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=56b484e3acc7205f0ebd71eec6905253eeace132
commit 56b484e3acc7205f0ebd71eec6905253eeace132
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Mon Mar 9 11:37:17 2009 +0100
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Mon Mar 9 11:37:17 2009 +0100

    sync-mode: rename mcast_iface structure to interface
    
    This patch renames the mcast_iface to interface since this nlif
    handler is not related with multicast itself, but to monitor the
    link interface used to propagate state-changes. This patch is a
    cleanup.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
       via  56b484e3acc7205f0ebd71eec6905253eeace132 (commit)
      from  39fdc2e703eb5e82b2bec25e49900684cf689386 (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 56b484e3acc7205f0ebd71eec6905253eeace132
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Mon Mar 9 11:37:17 2009 +0100

    sync-mode: rename mcast_iface structure to interface
    
    This patch renames the mcast_iface to interface since this nlif
    handler is not related with multicast itself, but to monitor the
    link interface used to propagate state-changes. This patch is a
    cleanup.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

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

 include/conntrackd.h |    2 +-
 src/sync-mode.c      |   26 +++++++++++++-------------
 2 files changed, 14 insertions(+), 14 deletions(-)
This patch renames the mcast_iface to interface since this nlif
handler is not related with multicast itself, but to monitor the
link interface used to propagate state-changes. This patch is a
cleanup.

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

diff --git a/include/conntrackd.h b/include/conntrackd.h
index 9615c2e..536abc9 100644
--- a/include/conntrackd.h
+++ b/include/conntrackd.h
@@ -165,7 +165,7 @@ struct ct_sync_state {
 
 	struct mcast_sock_multi *mcast_server;  /* multicast incoming */
 	struct mcast_sock_multi *mcast_client;  /* multicast outgoing  */
-	struct nlif_handle	*mcast_iface;
+	struct nlif_handle	*interface;
 	struct queue *tx_queue;
 
 	struct alarm_block		reset_cache_alarm;
diff --git a/src/sync-mode.c b/src/sync-mode.c
index ba504a5..b452cba 100644
--- a/src/sync-mode.c
+++ b/src/sync-mode.c
@@ -175,7 +175,7 @@ static void mcast_handler(struct mcast_sock *m, int if_idx)
 }
 
 /* select a new interface candidate in a round robin basis */
-static void mcast_iface_candidate(void)
+static void interface_candidate(void)
 {
 	int i, idx;
 	unsigned int flags;
@@ -185,7 +185,7 @@ static void mcast_iface_candidate(void)
 		idx = mcast_get_ifidx(STATE_SYNC(mcast_client), i);
 		if (idx == mcast_get_current_ifidx(STATE_SYNC(mcast_client)))
 			continue;
-		nlif_get_ifflags(STATE_SYNC(mcast_iface), idx, &flags);
+		nlif_get_ifflags(STATE_SYNC(interface), idx, &flags);
 		if (flags & (IFF_RUNNING | IFF_UP)) {
 			mcast_set_current_link(STATE_SYNC(mcast_client), i);
 			dlog(LOG_NOTICE, "device `%s' becomes multicast "
@@ -197,15 +197,15 @@ static void mcast_iface_candidate(void)
 	dlog(LOG_ERR, "no dedicated links available!");
 }
 
-static void mcast_iface_handler(void)
+static void interface_handler(void)
 {
 	int idx = mcast_get_current_ifidx(STATE_SYNC(mcast_client));
 	unsigned int flags;
 
-	nlif_catch(STATE_SYNC(mcast_iface));
-	nlif_get_ifflags(STATE_SYNC(mcast_iface), idx, &flags);
+	nlif_catch(STATE_SYNC(interface));
+	nlif_get_ifflags(STATE_SYNC(interface), idx, &flags);
 	if (!(flags & IFF_RUNNING) || !(flags & IFF_UP))
-		mcast_iface_candidate();
+		interface_candidate();
 }
 
 static void do_reset_cache_alarm(struct alarm_block *a, void *data)
@@ -299,12 +299,12 @@ static int init_sync(void)
 		return -1;
 	}
 
-	STATE_SYNC(mcast_iface) = nl_init_interface_handler();
-	if (!STATE_SYNC(mcast_iface)) {
+	STATE_SYNC(interface) = nl_init_interface_handler();
+	if (!STATE_SYNC(interface)) {
 		dlog(LOG_ERR, "can't open interface watcher");
 		return -1;
 	}
-	if (register_fd(nlif_fd(STATE_SYNC(mcast_iface)), STATE(fds)) == -1)
+	if (register_fd(nlif_fd(STATE_SYNC(interface)), STATE(fds)) == -1)
 		return -1;
 
 	STATE_SYNC(tx_queue) = queue_create(INT_MAX, QUEUE_F_EVFD);
@@ -337,8 +337,8 @@ static void run_sync(fd_set *readfds)
 	if (FD_ISSET(queue_get_eventfd(STATE_SYNC(tx_queue)), readfds))
 		STATE_SYNC(sync)->xmit();
 
-	if (FD_ISSET(nlif_fd(STATE_SYNC(mcast_iface)), readfds))
-		mcast_iface_handler();
+	if (FD_ISSET(nlif_fd(STATE_SYNC(interface)), readfds))
+		interface_handler();
 
 	/* flush pending messages */
 	mcast_buffered_pending_netmsg(STATE_SYNC(mcast_client));
@@ -352,7 +352,7 @@ static void kill_sync(void)
 	mcast_server_destroy_multi(STATE_SYNC(mcast_server));
 	mcast_client_destroy_multi(STATE_SYNC(mcast_client));
 
-	nlif_close(STATE_SYNC(mcast_iface));
+	nlif_close(STATE_SYNC(interface));
 
 	mcast_buffered_destroy();
 	queue_destroy(STATE_SYNC(tx_queue));
@@ -502,7 +502,7 @@ static int local_handler_sync(int fd, int type, void *data)
 	case STATS_MULTICAST:
 		mcast_dump_stats_extended(fd, STATE_SYNC(mcast_client),
 					      STATE_SYNC(mcast_server),
-					      STATE_SYNC(mcast_iface));
+					      STATE_SYNC(interface));
 		break;
 	default:
 		if (STATE_SYNC(sync)->local)



More information about the netfilter-cvslog mailing list