[conntrack-tools] mcast: remove several unused structure fields

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Fri Mar 20 17:06:00 CET 2009


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=16e6a01a6454dc791b7af593390616b4a29724c7
commit 16e6a01a6454dc791b7af593390616b4a29724c7
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Fri Mar 20 16:03:08 2009 +0100
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Fri Mar 20 16:03:08 2009 +0100

    mcast: remove several unused structure fields
    
    This patch removes several structure fields that are unused.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
       via  16e6a01a6454dc791b7af593390616b4a29724c7 (commit)
      from  f7b4b7bd19b16d11491f18891942f6d48c2fcf7e (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 16e6a01a6454dc791b7af593390616b4a29724c7
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Fri Mar 20 16:03:08 2009 +0100

    mcast: remove several unused structure fields
    
    This patch removes several structure fields that are unused.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

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

 include/mcast.h      |    4 ----
 src/mcast.c          |   17 -----------------
 src/read_config_yy.y |    4 +---
 3 files changed, 1 insertions(+), 24 deletions(-)
This patch removes several structure fields that are unused.

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

diff --git a/include/mcast.h b/include/mcast.h
index 30aefc0..38c77f9 100644
--- a/include/mcast.h
+++ b/include/mcast.h
@@ -18,11 +18,8 @@ struct mcast_conf {
 		struct in_addr interface_addr;
 		unsigned int interface_index6;
 	} ifa;
-	int mtu;
-	int interface_idx;
 	int sndbuf;
 	int rcvbuf;
-	char iface[IFNAMSIZ];
 };
 
 struct mcast_stats {
@@ -38,7 +35,6 @@ struct mcast_sock {
 		struct sockaddr_in6 ipv6;
 	} addr;
 	socklen_t sockaddr_len;
-	int interface_idx;
 	struct mcast_stats stats;
 };
 
diff --git a/src/mcast.c b/src/mcast.c
index 3dff855..600fdc2 100644
--- a/src/mcast.c
+++ b/src/mcast.c
@@ -46,8 +46,6 @@ struct mcast_sock *mcast_server_create(struct mcast_conf *conf)
 		return NULL;
 	memset(m, 0, sizeof(struct mcast_sock));
 
-	m->interface_idx = conf->interface_idx;
-
 	switch(conf->ipproto) {
 	case AF_INET:
 		mreq.ipv4.imr_multiaddr.s_addr = conf->in.inet_addr.s_addr;
@@ -78,19 +76,6 @@ struct mcast_sock *mcast_server_create(struct mcast_conf *conf)
 		return NULL;
 	}
 
-	if(conf->iface[0]) {
-		struct ifreq ifr;
-
-		strncpy(ifr.ifr_name, conf->iface, sizeof(ifr.ifr_name));
-
-		if (ioctl(m->fd, SIOCGIFMTU, &ifr) == -1) {
-			close(m->fd);
-			free(m);
-			return NULL;
-		}
-		conf->mtu = ifr.ifr_mtu;
-	}
-
 	if (setsockopt(m->fd, SOL_SOCKET, SO_REUSEADDR, &yes, 
 				sizeof(int)) == -1) {
 		close(m->fd);
@@ -214,8 +199,6 @@ struct mcast_sock *mcast_client_create(struct mcast_conf *conf)
 		return NULL;
 	memset(m, 0, sizeof(struct mcast_sock));
 
-	m->interface_idx = conf->interface_idx;
-
 	if ((m->fd = socket(conf->ipproto, SOCK_DGRAM, 0)) == -1) {
 		free(m);
 		return NULL;
diff --git a/src/read_config_yy.y b/src/read_config_yy.y
index 7b62cf3..4e60d95 100644
--- a/src/read_config_yy.y
+++ b/src/read_config_yy.y
@@ -330,7 +330,7 @@ multicast_option : T_IPV6_ADDR T_IP
 
 	conf.channel[conf.channel_num].u.mcast.ipproto = AF_INET6;
 
-	if (conf.channel[conf.channel_num].u.mcast.iface[0] &&
+	if (conf.channel[conf.channel_num].channel_ifname[0] &&
 	    !conf.channel[conf.channel_num].u.mcast.ifa.interface_index6) {
 		unsigned int idx;
 
@@ -376,14 +376,12 @@ multicast_option : T_IFACE T_STRING
 	__max_dedicated_links_reached();
 
 	strncpy(conf.channel[conf.channel_num].channel_ifname, $2, IFNAMSIZ);
-	strncpy(conf.channel[conf.channel_num].u.mcast.iface, $2, IFNAMSIZ);
 
 	idx = if_nametoindex($2);
 	if (!idx) {
 		fprintf(stderr, "%s is an invalid interface.\n", $2);
 		break;
 	}
-	conf.channel[conf.channel_num].u.mcast.interface_idx = idx;
 
 	if (conf.channel[conf.channel_num].u.mcast.ipproto == AF_INET6) {
 		conf.channel[conf.channel_num].u.mcast.ifa.interface_index6 = idx;



More information about the netfilter-cvslog mailing list