summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaul <paul>2003-01-22 19:45:50 +0000
committerpaul <paul>2003-01-22 19:45:50 +0000
commitd753e9eec96f03aa02a7648e4279c524c376908d (patch)
tree5434dea114f81d8596fc87a619f65c36629b4300
parentd4f5031c5c2ca3953d071cfce0a3faa34f9b073d (diff)
Matthew Grant <grantma@anathoth.gen.nz>
Subject: [zebra 17290] [PATCHES] - Fixes for problems in 0.93b Added ifupstaticfix
-rw-r--r--zebra/rt_netlink.c23
-rw-r--r--zebra/zebra_rib.c20
2 files changed, 38 insertions, 5 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 94573aa5..4f4ebb7a 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -245,11 +245,26 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
nl->name);
return -1;
}
- zlog (NULL, LOG_ERR, "%s error: %s, type=%s(%u), seq=%u, pid=%d",
- nl->name, strerror (-err->error),
- lookup (nlmsg_str, err->msg.nlmsg_type),
- err->msg.nlmsg_type, err->msg.nlmsg_seq,
+
+ /* Deal with Error Noise - MAG*/
+ {
+ int loglvl = LOG_ERR;
+ int errnum = err->error;
+ int msg_type = err->msg.nlmsg_type;
+
+ if (nl == &netlink_cmd
+ && (-errnum == ENODEV || -errnum == ESRCH)
+ && (msg_type == RTM_NEWROUTE
+ || msg_type == RTM_DELROUTE))
+ loglvl = LOG_DEBUG;
+
+ zlog (NULL, loglvl, "%s error: %s, type=%s(%u), "
+ "seq=%u, pid=%d",
+ nl->name, strerror (-errnum),
+ lookup (nlmsg_str, msg_type),
+ msg_type, err->msg.nlmsg_seq,
err->msg.nlmsg_pid);
+ }
/*
ret = -1;
continue;
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index ec07e2e3..0f7ccebc 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -855,11 +855,13 @@ rib_process (struct route_node *rn, struct rib *del)
struct rib *next;
struct rib *fib = NULL;
struct rib *select = NULL;
+ int installed = 0;
+ struct nexthop *nexthop = NULL;
for (rib = rn->info; rib; rib = next)
{
next = rib->next;
-
+
/* Currently installed rib. */
if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
fib = rib;
@@ -898,6 +900,22 @@ rib_process (struct route_node *rn, struct rib *del)
rib_install_kernel (rn, select);
redistribute_add (&rn->p, select);
}
+ else if (! RIB_SYSTEM_ROUTE (select))
+ {
+ /* Housekeeping code to deal with
+ race conditions in kernel with linux
+ netlink reporting interface up before IPv4 or IPv6 protocol
+ is ready to add routes.
+ This makes sure the routes are IN the kernel.
+ */
+
+ for (nexthop = select->nexthop; nexthop; nexthop = nexthop->next)
+ {
+ if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
+ installed = 1;
+ }
+ if (! installed) rib_install_kernel (rn, select);
+ }
return;
}