aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/mrouted/mapper.c
diff options
context:
space:
mode:
authorBill Fenner <fenner@FreeBSD.org>1999-01-20 07:44:18 +0000
committerBill Fenner <fenner@FreeBSD.org>1999-01-20 07:44:18 +0000
commit1f25327484733d0bec3b33044da7bd5d82ad007f (patch)
tree19c94eeb7ba2b59b0ad53ae0864ebf06723a8afa /usr.sbin/mrouted/mapper.c
parentce595def0708b60ce4dde9002ac206fae20be240 (diff)
Import mrouted version 3.9-beta3+IOS12 . This is a version of 3.9-beta3vendor/mrouted
with minor changes to work around a bug in Cisco's IOS version 12.0 . 3.9-beta3 is much improved over 3.8, and is only labelled "beta" because of missing features, as opposed to instability or known bugs.
Notes
Notes: svn path=/cvs2svn/branches/XEROX/; revision=42888
Diffstat (limited to 'usr.sbin/mrouted/mapper.c')
-rw-r--r--usr.sbin/mrouted/mapper.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.sbin/mrouted/mapper.c b/usr.sbin/mrouted/mapper.c
index 1eacd04bb61d..c53ec074455e 100644
--- a/usr.sbin/mrouted/mapper.c
+++ b/usr.sbin/mrouted/mapper.c
@@ -1,7 +1,7 @@
/* Mapper for connections between MRouteD multicast routers.
* Written by Pavel Curtis <Pavel@PARC.Xerox.Com>
*
- * $Id: mapper.c,v 3.8 1995/11/29 22:36:57 fenner Rel $
+ * mapper.c,v 3.8.4.3 1998/01/06 01:57:47 fenner Exp
*/
/*
@@ -32,6 +32,11 @@
#include <varargs.h>
#endif
+#ifndef lint
+static char rcsid[] = "@(#) $Id: \
+mapper.c,v 3.8.4.3 1998/01/06 01:57:47 fenner Exp $";
+#endif
+
#define DEFAULT_TIMEOUT 2 /* How long to wait before retrying requests */
#define DEFAULT_RETRIES 1 /* How many times to ask each router */
@@ -844,13 +849,16 @@ int main(argc, argv)
{
int flood = FALSE, graph = FALSE;
- setlinebuf(stderr);
-
if (geteuid() != 0) {
- fprintf(stderr, "must be root\n");
+ fprintf(stderr, "map-mbone: must be root\n");
exit(1);
}
+ init_igmp();
+ setuid(getuid());
+
+ setlinebuf(stderr);
+
argv++, argc--;
while (argc > 0 && argv[0][0] == '-') {
switch (argv[0][1]) {
@@ -899,15 +907,13 @@ int main(argc, argv)
if (debug)
fprintf(stderr, "Debug level %u\n", debug);
- init_igmp();
-
{ /* Find a good local address for us. */
int udp;
struct sockaddr_in addr;
int addrlen = sizeof(addr);
addr.sin_family = AF_INET;
-#if (defined(BSD) && (BSD >= 199103))
+#ifdef HAVE_SA_LEN
addr.sin_len = sizeof addr;
#endif
addr.sin_addr.s_addr = dvmrp_group;