summaryrefslogtreecommitdiffstats
path: root/usr.sbin/routed/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/routed/main.c')
-rw-r--r--usr.sbin/routed/main.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/usr.sbin/routed/main.c b/usr.sbin/routed/main.c
index 20b72d8..b96fe71 100644
--- a/usr.sbin/routed/main.c
+++ b/usr.sbin/routed/main.c
@@ -34,9 +34,12 @@
char copyright[] =
"@(#) Copyright (c) 1983, 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n";
-#if !defined(lint) && !defined(sgi)
+#if !defined(lint) && !defined(sgi) && !defined(__NetBSD__)
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/5/93";
-#endif /* not lint */
+#elif defined(__NetBSD__)
+static char rcsid[] = "$NetBSD$";
+#endif
+#ident "$Revision: 1.1.3.3 $"
#include "defs.h"
#include "pathnames.h"
@@ -272,14 +275,7 @@ usage:
if (setsockopt(rt_sock, SOL_SOCKET,SO_USELOOPBACK,
&off,sizeof(off)) < 0)
LOGERR("setsockopt(SO_USELOOPBACK,0)");
-
- /* prepare Router Discovery socket.
- */
- rdisc_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
- if (rdisc_sock < 0)
- BADERR(1,"rdisc_sock = socket()");
- fix_sock(rdisc_sock,"rdisc_sock");
-
+
fix_select();
@@ -733,6 +729,19 @@ rip_on(struct interface *ifp)
}
+/* die if malloc(3) fails
+ */
+void *
+rtmalloc(size_t size,
+ char *msg)
+{
+ void *p = malloc(size);
+ if (p == 0)
+ logbad(1,"malloc() failed in %s", msg);
+ return p;
+}
+
+
/* get a random instant in an interval
*/
void
OpenPOWER on IntegriCloud