diff options
Diffstat (limited to 'snmp_mibII/mibII_route.c')
-rw-r--r-- | snmp_mibII/mibII_route.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/snmp_mibII/mibII_route.c b/snmp_mibII/mibII_route.c index e17497d44ec9..e8b2535ee88a 100644 --- a/snmp_mibII/mibII_route.c +++ b/snmp_mibII/mibII_route.c @@ -4,7 +4,7 @@ * All rights reserved. * * Author: Harti Brandt <harti@freebsd.org> - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -30,7 +30,6 @@ * * Routing table */ -#include "support.h" #ifdef HAVE_SYS_TREE_H #include <sys/tree.h> @@ -48,7 +47,7 @@ struct sroute { uint8_t type; uint8_t proto; }; -RB_HEAD(sroutes, sroute) sroutes = RB_INITIALIZER(&sroutes); +static RB_HEAD(sroutes, sroute) sroutes = RB_INITIALIZER(&sroutes); RB_PROTOTYPE(sroutes, sroute, link, sroute_compare); @@ -186,8 +185,7 @@ mib_sroute_process(struct rt_msghdr *rtm, struct sockaddr *gw, memcpy(r->index, key.index, sizeof(r->index)); r->ifindex = (ifp == NULL) ? 0 : ifp->index; - r->type = (rtm->rtm_flags & RTF_LLINFO) ? 3 : - (rtm->rtm_flags & RTF_REJECT) ? 2 : 4; + r->type = (rtm->rtm_flags & RTF_REJECT) ? 2 : 4; /* cannot really know, what protocol it runs */ r->proto = (rtm->rtm_flags & RTF_LOCAL) ? 2 : @@ -259,7 +257,7 @@ mib_fetch_route(void) continue; mib_extract_addrs(rtm->rtm_addrs, (u_char *)(rtm + 1), addrs); - + mib_sroute_process(rtm, addrs[RTAX_GATEWAY], addrs[RTAX_DST], addrs[RTAX_NETMASK]); } |