summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-11-16 15:54:50 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-11-16 15:54:50 +0000
commitc63c36c18b18d84ae7b535b8fe4fb795d2d583eb (patch)
tree27d6fe56bc8452eadc23a4bdbc8f13b60bf846aa /usr.sbin
parent0f163edfa60703128c47cd31b470e2ecd222cf6f (diff)
for now, make bgpd work with routing table 0 (main one) and ignore routing
messages for any other tables. real multi-table support is more adventurous (will come tho)
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/kroute.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c
index e751b9784bf..f32b6b3c0a6 100644
--- a/usr.sbin/bgpd/kroute.c
+++ b/usr.sbin/bgpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.147 2006/08/03 22:40:25 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.148 2006/11/16 15:54:49 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1880,7 +1880,7 @@ int
fetchtable(void)
{
size_t len;
- int mib[6];
+ int mib[7];
char *buf, *next, *lim;
struct rt_msghdr *rtm;
struct sockaddr *sa, *gw, *rti_info[RTAX_MAX];
@@ -1895,6 +1895,7 @@ fetchtable(void)
mib[3] = 0;
mib[4] = NET_RT_DUMP;
mib[5] = 0;
+ mib[6] = 0; /* rtableid */
if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1) {
log_warn("sysctl");
@@ -2133,6 +2134,9 @@ dispatch_rtmsg(void)
for (next = buf; next < lim; next += rtm->rtm_msglen) {
rtm = (struct rt_msghdr *)next;
+ if (rtm->rtm_tableid != 0)
+ continue;
+
switch (rtm->rtm_type) {
case RTM_ADD:
case RTM_CHANGE: