summaryrefslogtreecommitdiffstats
path: root/usr.sbin/route6d/route6d.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2000-11-27 17:44:53 +0000
committerume <ume@FreeBSD.org>2000-11-27 17:44:53 +0000
commit5e6c6dce08fbcf913df1c9e0c94f5aea12b672b5 (patch)
tree23462a8d73aa3fe63f257ec001b03a1b86a62db4 /usr.sbin/route6d/route6d.c
parent8055e0329eeff6fa7d9ba33d74e093cd2d748e94 (diff)
downloadFreeBSD-src-5e6c6dce08fbcf913df1c9e0c94f5aea12b672b5.zip
FreeBSD-src-5e6c6dce08fbcf913df1c9e0c94f5aea12b672b5.tar.gz
- do not check/advertise cloned routes, nor dynamic routes
- cast size_t on printing (be friendly with alpha) Obtained from: KAME
Diffstat (limited to 'usr.sbin/route6d/route6d.c')
-rw-r--r--usr.sbin/route6d/route6d.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c
index b5a91a9..264206e 100644
--- a/usr.sbin/route6d/route6d.c
+++ b/usr.sbin/route6d/route6d.c
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-/* $KAME: route6d.c,v 1.35 2000/08/13 00:39:44 itojun Exp $ */
+/* $KAME: route6d.c,v 1.37 2000/10/10 13:02:30 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,7 +31,7 @@
*/
#ifndef lint
-static char _rcsid[] = "$KAME: route6d.c,v 1.35 2000/08/13 00:39:44 itojun Exp $";
+static char _rcsid[] = "$KAME: route6d.c,v 1.37 2000/10/10 13:02:30 itojun Exp $";
#endif
#include <stdio.h>
@@ -1459,8 +1459,8 @@ rtrecv()
exit(-1);
}
if (len < sizeof(*rtm)) {
- trace(1, "short read from rtsock: %d (should be > %d)\n",
- len, sizeof(*rtm));
+ trace(1, "short read from rtsock: %d (should be > %lu)\n",
+ len, (u_long)sizeof(*rtm));
return;
}
@@ -2220,7 +2220,8 @@ krtread(again)
}
} while (retry < 5 && errmsg != NULL);
if (errmsg)
- fatal("%s (with %d retries, msize=%d)", errmsg, retry, msize);
+ fatal("%s (with %d retries, msize=%lu)", errmsg, retry,
+ (u_long)msize);
else if (1 < retry)
syslog(LOG_INFO, "NET_RT_DUMP %d retires", retry);
@@ -2249,6 +2250,21 @@ rt_entry(rtm, again)
(RTF_CLONING|RTF_XRESOLVE|RTF_LLINFO|RTF_BLACKHOLE)) {
return; /* not interested in the link route */
}
+ /* do not look at cloned routes */
+#ifdef RTF_WASCLONED
+ if (rtm->rtm_flags & RTF_WASCLONED)
+ return;
+#endif
+#ifdef RTF_CLONED
+ if (rtm->rtm_flags & RTF_CLONED)
+ return;
+#endif
+ /*
+ * do not look at dynamic routes.
+ * netbsd/openbsd cloned routes have UGHD.
+ */
+ if (rtm->rtm_flags & RTF_DYNAMIC)
+ return;
rtmp = (char *)(rtm + 1);
/* Destination */
if ((rtm->rtm_addrs & RTA_DST) == 0)
OpenPOWER on IntegriCloud