summaryrefslogtreecommitdiff
path: root/src/mcast.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2007-07-18 20:04:00 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2007-07-18 20:04:00 +0000
commit18bbf19becaab7dc4137406928f96ad089192f69 (patch)
treec6d75df8591e20083044cbf07d73e8f6738fd1fd /src/mcast.c
parent96084e1a1f2e0a49c961bbddb9fffd2e03bfae3f (diff)
downloadconntrack-tools-18bbf19becaab7dc4137406928f96ad089192f69.tar.gz
conntrack-tools-18bbf19becaab7dc4137406928f96ad089192f69.zip
conntrackd:
- use buffer of MTU size conntrack: - better protocol argument checkings - fix per-protocol filtering, eg. conntrack -[L|E] -p tcp now works - show per-protocol help, ie. conntrack -h -p tcp - add alias --src for --orig-src and alias --dst for --orig-dst
Diffstat (limited to 'src/mcast.c')
-rw-r--r--src/mcast.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mcast.c b/src/mcast.c
index 6193a59..cdaed5f 100644
--- a/src/mcast.c
+++ b/src/mcast.c
@@ -26,6 +26,8 @@
#include <sys/time.h>
#include <unistd.h>
#include <string.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
#include "mcast.h"
#include "debug.h"
@@ -71,6 +73,18 @@ 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) {
+ debug("ioctl");
+ return NULL;
+ }
+ conf->mtu = ifr.ifr_mtu;
+ }
+
if (setsockopt(m->fd, SOL_SOCKET, SO_REUSEADDR, &yes,
sizeof(int)) == -1) {
debug("mcast_sock_server_create:setsockopt1");