summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/mrouted/Makefile5
-rw-r--r--usr.sbin/mrouted/Makefile.inc1
-rw-r--r--usr.sbin/mrouted/common/Makefile17
-rw-r--r--usr.sbin/mrouted/defs.h2
-rw-r--r--usr.sbin/mrouted/igmp.c4
-rw-r--r--usr.sbin/mrouted/map-mbone/Makefile20
-rw-r--r--usr.sbin/mrouted/mapper.c3
-rw-r--r--usr.sbin/mrouted/mrinfo.c3
-rw-r--r--usr.sbin/mrouted/mrinfo/Makefile20
-rw-r--r--usr.sbin/mrouted/mrouted/Makefile20
-rw-r--r--usr.sbin/mrouted/mtrace.c3
-rw-r--r--usr.sbin/mrouted/mtrace/Makefile20
-rw-r--r--usr.sbin/mrouted/vif.c2
13 files changed, 116 insertions, 4 deletions
diff --git a/usr.sbin/mrouted/Makefile b/usr.sbin/mrouted/Makefile
new file mode 100644
index 0000000..c77b1fb
--- /dev/null
+++ b/usr.sbin/mrouted/Makefile
@@ -0,0 +1,5 @@
+# $Id$
+
+SUBDIR= common mrouted mrinfo map-mbone mtrace
+
+.include <bsd.subdir.mk>
diff --git a/usr.sbin/mrouted/Makefile.inc b/usr.sbin/mrouted/Makefile.inc
new file mode 100644
index 0000000..8137233
--- /dev/null
+++ b/usr.sbin/mrouted/Makefile.inc
@@ -0,0 +1 @@
+.include "${.CURDIR}/../../Makefile.inc"
diff --git a/usr.sbin/mrouted/common/Makefile b/usr.sbin/mrouted/common/Makefile
new file mode 100644
index 0000000..9bcfb27
--- /dev/null
+++ b/usr.sbin/mrouted/common/Makefile
@@ -0,0 +1,17 @@
+# $Id$
+
+LIB= mrouted
+NOPROFILE=
+NOSHARED=
+
+S= ${.CURDIR}/..
+.PATH: $S
+CFLAGS+= -I$S
+
+SRCS= igmp.c inet.c kern.c
+NOMAN=
+
+# nothing to install
+install:
+
+.include <bsd.lib.mk>
diff --git a/usr.sbin/mrouted/defs.h b/usr.sbin/mrouted/defs.h
index 8239f7c..a0a9f4a 100644
--- a/usr.sbin/mrouted/defs.h
+++ b/usr.sbin/mrouted/defs.h
@@ -85,7 +85,9 @@ extern char s3[];
extern int errno;
extern int sys_nerr;
+#ifndef __FreeBSD__
extern char * sys_errlist[];
+#endif
extern void log();
diff --git a/usr.sbin/mrouted/igmp.c b/usr.sbin/mrouted/igmp.c
index f44e2f1..7ddf3bc 100644
--- a/usr.sbin/mrouted/igmp.c
+++ b/usr.sbin/mrouted/igmp.c
@@ -41,6 +41,8 @@ void init_igmp()
k_set_loop(FALSE); /* disable multicast loopback */
ip = (struct ip *)send_buf;
+ ip->ip_hl = sizeof(struct ip) >> 2;
+ ip->ip_v = IPVERSION;
ip->ip_tos = 0;
ip->ip_off = 0;
ip->ip_p = IPPROTO_IGMP;
@@ -255,7 +257,7 @@ void send_igmp(src, dst, type, code, group, datalen)
u_long group;
int datalen;
{
- static struct sockaddr_in sdst = {AF_INET};
+ static struct sockaddr_in sdst = {AF_INET, sizeof sdst};
struct ip *ip;
struct igmp *igmp;
diff --git a/usr.sbin/mrouted/map-mbone/Makefile b/usr.sbin/mrouted/map-mbone/Makefile
new file mode 100644
index 0000000..4303cf2
--- /dev/null
+++ b/usr.sbin/mrouted/map-mbone/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+
+PROG= map-mbone
+
+S= ${.CURDIR}/..
+.PATH: $S
+CFLAGS+= -I$S
+LDADD+= -lmrouted
+.if exists($S/common/obj)
+LDDESTDIR+= -L$S/common/obj
+DPADD+= $S/common/obj/libmrouted.a
+.else
+LDDESTDIR+= -L$S/common
+DPADD+= $S/common/libmrouted.a
+.endif
+
+SRCS= mapper.c
+NOMAN=
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/mrouted/mapper.c b/usr.sbin/mrouted/mapper.c
index 64a05b5..5dba17c 100644
--- a/usr.sbin/mrouted/mapper.c
+++ b/usr.sbin/mrouted/mapper.c
@@ -575,7 +575,7 @@ char *inet_name(addr)
{
struct hostent *e;
- e = gethostbyaddr(&addr, sizeof(addr), AF_INET);
+ e = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET);
return e ? e->h_name : 0;
}
@@ -862,6 +862,7 @@ main(argc, argv)
int addrlen = sizeof(addr);
addr.sin_family = AF_INET;
+ addr.sin_len = sizeof addr;
addr.sin_addr.s_addr = dvmrp_group;
addr.sin_port = htons(2000); /* any port over 1024 will do... */
if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0
diff --git a/usr.sbin/mrouted/mrinfo.c b/usr.sbin/mrouted/mrinfo.c
index d774cdf..a24a2e3 100644
--- a/usr.sbin/mrouted/mrinfo.c
+++ b/usr.sbin/mrouted/mrinfo.c
@@ -88,7 +88,7 @@ inet_name(addr)
{
struct hostent *e;
- e = gethostbyaddr(&addr, sizeof(addr), AF_INET);
+ e = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET);
return e ? e->h_name : "?";
}
@@ -326,6 +326,7 @@ usage: fprintf(stderr,
int addrlen = sizeof(addr);
addr.sin_family = AF_INET;
+ addr.sin_len = sizeof addr;
addr.sin_addr.s_addr = target_addr;
addr.sin_port = htons(2000); /* any port over 1024 will
* do... */
diff --git a/usr.sbin/mrouted/mrinfo/Makefile b/usr.sbin/mrouted/mrinfo/Makefile
new file mode 100644
index 0000000..bc444ac
--- /dev/null
+++ b/usr.sbin/mrouted/mrinfo/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+
+PROG= mrinfo
+
+S= ${.CURDIR}/..
+.PATH: $S
+CFLAGS+= -I$S
+LDADD+= -lmrouted
+.if exists($S/common/obj)
+LDDESTDIR+= -L$S/common/obj
+DPADD+= $S/common/obj/libmrouted.a
+.else
+LDDESTDIR+= -L$S/common
+DPADD+= $S/common/libmrouted.a
+.endif
+
+SRCS= mrinfo.c
+NOMAN=
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/mrouted/mrouted/Makefile b/usr.sbin/mrouted/mrouted/Makefile
new file mode 100644
index 0000000..12c4495
--- /dev/null
+++ b/usr.sbin/mrouted/mrouted/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+
+PROG= mrouted
+
+S= ${.CURDIR}/..
+.PATH: $S
+CFLAGS+= -I$S
+LDADD+= -lmrouted
+.if exists($S/common/obj)
+LDDESTDIR+= -L$S/common/obj
+DPADD+= $S/common/obj/libmrouted.a
+.else
+LDDESTDIR+= -L$S/common
+DPADD+= $S/common/libmrouted.a
+.endif
+
+SRCS= config.c main.c route.c vif.c prune.c callout.c
+MAN8= ${.CURDIR}/../mrouted.8
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/mrouted/mtrace.c b/usr.sbin/mrouted/mtrace.c
index 9bee6b2..5a8870e 100644
--- a/usr.sbin/mrouted/mtrace.c
+++ b/usr.sbin/mrouted/mtrace.c
@@ -16,7 +16,7 @@ inet_name(addr)
{
struct hostent *e;
- e = gethostbyaddr(&addr, sizeof(addr), AF_INET);
+ e = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET);
return e ? e->h_name : "?";
}
@@ -219,6 +219,7 @@ usage: printf("usage: mtrace -s <src> -g <grp> -d <dst> -n <# reports> \n");
/* Obtain the local address from which to send out packets */
addr.sin_family = AF_INET;
+ addr.sin_len = sizeof addr;
addr.sin_addr.s_addr = qgrp;
addr.sin_port = htons(2000);
diff --git a/usr.sbin/mrouted/mtrace/Makefile b/usr.sbin/mrouted/mtrace/Makefile
new file mode 100644
index 0000000..2dd538b
--- /dev/null
+++ b/usr.sbin/mrouted/mtrace/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+
+PROG= mtrace
+
+S= ${.CURDIR}/..
+.PATH: $S
+CFLAGS+= -I$S
+LDADD+= -lmrouted
+.if exists($S/common/obj)
+LDDESTDIR+= -L$S/common/obj
+DPADD+= $S/common/obj/libmrouted.a
+.else
+LDDESTDIR+= -L$S/common
+DPADD+= $S/common/libmrouted.a
+.endif
+
+SRCS= mtrace.c
+NOMAN=
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/mrouted/vif.c b/usr.sbin/mrouted/vif.c
index bf7b867..b71a043 100644
--- a/usr.sbin/mrouted/vif.c
+++ b/usr.sbin/mrouted/vif.c
@@ -569,6 +569,7 @@ void accept_neighbor_request(src, dst)
int addrlen = sizeof(addr);
addr.sin_family = AF_INET;
+ addr.sin_len = sizeof addr;
addr.sin_addr.s_addr = dst;
addr.sin_port = htons(2000); /* any port over 1024 will do... */
if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0
@@ -652,6 +653,7 @@ void accept_neighbor_request2(src, dst)
int addrlen = sizeof(addr);
addr.sin_family = AF_INET;
+ addr.sin_len = sizeof addr;
addr.sin_addr.s_addr = dst;
addr.sin_port = htons(2000); /* any port over 1024 will do... */
if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0
OpenPOWER on IntegriCloud