From c63c36c18b18d84ae7b535b8fe4fb795d2d583eb Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Thu, 16 Nov 2006 15:54:50 +0000 Subject: 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) --- usr.sbin/bgpd/kroute.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usr.sbin') 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 @@ -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: -- cgit v1.2.3