diff options
-rw-r--r-- | usr.sbin/mrouted/Makefile | 5 | ||||
-rw-r--r-- | usr.sbin/mrouted/Makefile.inc | 1 | ||||
-rw-r--r-- | usr.sbin/mrouted/common/Makefile | 17 | ||||
-rw-r--r-- | usr.sbin/mrouted/defs.h | 2 | ||||
-rw-r--r-- | usr.sbin/mrouted/igmp.c | 4 | ||||
-rw-r--r-- | usr.sbin/mrouted/map-mbone/Makefile | 20 | ||||
-rw-r--r-- | usr.sbin/mrouted/mapper.c | 3 | ||||
-rw-r--r-- | usr.sbin/mrouted/mrinfo.c | 3 | ||||
-rw-r--r-- | usr.sbin/mrouted/mrinfo/Makefile | 20 | ||||
-rw-r--r-- | usr.sbin/mrouted/mrouted/Makefile | 20 | ||||
-rw-r--r-- | usr.sbin/mrouted/mtrace.c | 3 | ||||
-rw-r--r-- | usr.sbin/mrouted/mtrace/Makefile | 20 | ||||
-rw-r--r-- | usr.sbin/mrouted/vif.c | 2 |
13 files changed, 116 insertions, 4 deletions
diff --git a/usr.sbin/mrouted/Makefile b/usr.sbin/mrouted/Makefile new file mode 100644 index 000000000000..c77b1fb06fd4 --- /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 000000000000..8137233ad6fa --- /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 000000000000..9bcfb27462bc --- /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 8239f7ca961e..a0a9f4a07cdf 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 f44e2f1616f2..7ddf3bc115a7 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 000000000000..4303cf28267c --- /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 64a05b5f8d24..5dba17c149af 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 d774cdfa5eaa..a24a2e3781d5 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 000000000000..bc444acd312e --- /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 000000000000..12c4495a610a --- /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 9bee6b248e52..5a8870e9c339 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 000000000000..2dd538b25b81 --- /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 bf7b8673159c..b71a043f3bbc 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 |