diff options
-rw-r--r-- | zebra/connected.c | 2 | ||||
-rw-r--r-- | zebra/rt_netlink.c | 47 |
2 files changed, 21 insertions, 28 deletions
diff --git a/zebra/connected.c b/zebra/connected.c index 8bf1d337..ca22a011 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -86,7 +86,7 @@ connected_announce (struct interface *ifp, struct connected *ifc) zebra_interface_address_add_update (ifp, ifc); - if (if_is_up(ifp)) + if (if_is_operative(ifp)) { if (ifc->address->family == AF_INET) connected_up_ipv4 (ifp, ifc); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index c6ec08c6..ba66ab90 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -327,6 +327,8 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *), if (h->nlmsg_type == NLMSG_ERROR) { struct nlmsgerr *err = (struct nlmsgerr *) NLMSG_DATA (h); + int errnum = err->error; + int msg_type = err->msg.nlmsg_type; /* If the error field is zero, then this is an ACK */ if (err->error == 0) @@ -355,33 +357,24 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *), return -1; } - /* 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)) - { - /* These errors are normal during link transistion */ - if (IS_ZEBRA_DEBUG_KERNEL) - loglvl = LOG_DEBUG; - else - return -1; - } - - zlog (NULL, loglvl, "%s error: %s, type=%s(%u), " - "seq=%u, pid=%u", - nl->name, safe_strerror (-errnum), - lookup (nlmsg_str, msg_type), - msg_type, err->msg.nlmsg_seq, err->msg.nlmsg_pid); - } - /* - ret = -1; - continue; - */ + /* Deal with errors that occur because of races in link handling */ + if (nl == &netlink_cmd + && ((msg_type == RTM_DELROUTE && + (-errnum == ENODEV || -errnum == ESRCH)) + || (msg_type == RTM_NEWROUTE && -errnum == EEXIST))) + { + if (IS_ZEBRA_DEBUG_KERNEL) + zlog_debug ("%s: error: %s type=%s(%u), seq=%u, pid=%u", + nl->name, safe_strerror (-errnum), + lookup (nlmsg_str, msg_type), + msg_type, err->msg.nlmsg_seq, err->msg.nlmsg_pid); + return 0; + } + + zlog_err ("%s error: %s, type=%s(%u), seq=%u, pid=%u", + nl->name, safe_strerror (-errnum), + lookup (nlmsg_str, msg_type), + msg_type, err->msg.nlmsg_seq, err->msg.nlmsg_pid); return -1; } |