diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-08-16 20:10:32 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-09-06 20:56:38 +0000 |
| commit | 9df414feebc0748bbff2ea9071c76be59618e8e6 (patch) | |
| tree | 3620b5236cc2c247a4aeb4633cb44e5c6042a615 /zebra/rt_netlink.c | |
| parent | dbb93f1b90be4cad6483874b843e309186c4b1ce (diff) | |
zebra: flog_warn conversion
Convert Zebra to user error subsystem.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/rt_netlink.c')
| -rw-r--r-- | zebra/rt_netlink.c | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 3683596b41..7f475fe7d7 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -153,8 +153,9 @@ static inline int zebra2proto(int proto) * is intentionally a warn because we should see * this as part of development of a new protocol */ - zlog_warn("%s: Please add this protocol(%d) to proper rt_netlink.c handling", - __PRETTY_FUNCTION__, proto); + zlog_debug( + "%s: Please add this protocol(%d) to proper rt_netlink.c handling", + __PRETTY_FUNCTION__, proto); proto = RTPROT_ZEBRA; break; } @@ -210,9 +211,9 @@ static inline int proto2zebra(int proto, int family) * is intentionally a warn because we should see * this as part of development of a new protocol */ - zlog_warn("%s: Please add this protocol(%d) to proper rt_netlink.c handling", - __PRETTY_FUNCTION__, - proto); + zlog_debug( + "%s: Please add this protocol(%d) to proper rt_netlink.c handling", + __PRETTY_FUNCTION__, proto); proto = ZEBRA_ROUTE_KERNEL; break; } @@ -426,8 +427,10 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, if (rtm->rtm_src_len != 0) { char buf[PREFIX_STRLEN]; - zlog_warn("unsupported IPv4 sourcedest route (dest %s vrf %u)", - prefix2str(&p, buf, sizeof(buf)), vrf_id); + flog_warn( + ZEBRA_ERR_UNSUPPORTED_V4_SRCDEST, + "unsupported IPv4 sourcedest route (dest %s vrf %u)", + prefix2str(&p, buf, sizeof(buf)), vrf_id); return 0; } @@ -594,7 +597,8 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, if (ifp) nh_vrf_id = ifp->vrf_id; else { - zlog_warn( + flog_warn( + ZEBRA_ERR_UNKNOWN_INTERFACE, "%s: Unknown interface %u specified, defaulting to VRF_DEFAULT", __PRETTY_FUNCTION__, index); @@ -817,12 +821,13 @@ int netlink_route_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) if (!(h->nlmsg_type == RTM_NEWROUTE || h->nlmsg_type == RTM_DELROUTE)) { /* If this is not route add/delete message print warning. */ - zlog_warn("Kernel message: %d NS %u\n", h->nlmsg_type, ns_id); + zlog_debug("Kernel message: %d NS %u\n", h->nlmsg_type, ns_id); return 0; } if (!(rtm->rtm_family == AF_INET || rtm->rtm_family == AF_INET6)) { - zlog_warn( + flog_warn( + ZEBRA_ERR_UNKNOWN_FAMILY, "Invalid address family: %u received from kernel route change: %u", rtm->rtm_family, h->nlmsg_type); return 0; @@ -1951,10 +1956,10 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id) zif = (struct zebra_if *)ifp->info; if ((br_if = zif->brslave_info.br_if) == NULL) { - zlog_warn("%s family %s IF %s(%u) brIF %u - no bridge master", - nl_msg_type_to_str(h->nlmsg_type), - nl_family_to_str(ndm->ndm_family), ifp->name, - ndm->ndm_ifindex, zif->brslave_info.bridge_ifindex); + zlog_debug("%s family %s IF %s(%u) brIF %u - no bridge master", + nl_msg_type_to_str(h->nlmsg_type), + nl_family_to_str(ndm->ndm_family), ifp->name, + ndm->ndm_ifindex, zif->brslave_info.bridge_ifindex); return 0; } @@ -1963,15 +1968,15 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id) netlink_parse_rtattr(tb, NDA_MAX, NDA_RTA(ndm), len); if (!tb[NDA_LLADDR]) { - zlog_warn("%s family %s IF %s(%u) brIF %u - no LLADDR", - nl_msg_type_to_str(h->nlmsg_type), - nl_family_to_str(ndm->ndm_family), ifp->name, - ndm->ndm_ifindex, zif->brslave_info.bridge_ifindex); + zlog_debug("%s family %s IF %s(%u) brIF %u - no LLADDR", + nl_msg_type_to_str(h->nlmsg_type), + nl_family_to_str(ndm->ndm_family), ifp->name, + ndm->ndm_ifindex, zif->brslave_info.bridge_ifindex); return 0; } if (RTA_PAYLOAD(tb[NDA_LLADDR]) != ETH_ALEN) { - zlog_warn( + zlog_debug( "%s family %s IF %s(%u) brIF %u - LLADDR is not MAC, len %lu", nl_msg_type_to_str(h->nlmsg_type), nl_family_to_str(ndm->ndm_family), ifp->name, @@ -2167,9 +2172,9 @@ static int netlink_macfdb_update(struct interface *ifp, vlanid_t vid, zns = zvrf->zns; zif = ifp->info; if ((br_if = zif->brslave_info.br_if) == NULL) { - zlog_warn("MAC %s on IF %s(%u) - no mapping to bridge", - (cmd == RTM_NEWNEIGH) ? "add" : "del", ifp->name, - ifp->ifindex); + zlog_debug("MAC %s on IF %s(%u) - no mapping to bridge", + (cmd == RTM_NEWNEIGH) ? "add" : "del", ifp->name, + ifp->ifindex); return -1; } @@ -2252,10 +2257,10 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id) netlink_parse_rtattr(tb, NDA_MAX, NDA_RTA(ndm), len); if (!tb[NDA_DST]) { - zlog_warn("%s family %s IF %s(%u) - no DST", - nl_msg_type_to_str(h->nlmsg_type), - nl_family_to_str(ndm->ndm_family), ifp->name, - ndm->ndm_ifindex); + zlog_debug("%s family %s IF %s(%u) - no DST", + nl_msg_type_to_str(h->nlmsg_type), + nl_family_to_str(ndm->ndm_family), ifp->name, + ndm->ndm_ifindex); return 0; } @@ -2311,7 +2316,7 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id) if (h->nlmsg_type == RTM_NEWNEIGH) { if (tb[NDA_LLADDR]) { if (RTA_PAYLOAD(tb[NDA_LLADDR]) != ETH_ALEN) { - zlog_warn( + zlog_debug( "%s family %s IF %s(%u) - LLADDR is not MAC, len %lu", nl_msg_type_to_str(h->nlmsg_type), nl_family_to_str(ndm->ndm_family), @@ -2473,7 +2478,8 @@ int netlink_neigh_change(struct nlmsghdr *h, ns_id_t ns_id) if (ndm->ndm_family == AF_INET || ndm->ndm_family == AF_INET6) return netlink_ipneigh_change(h, len, ns_id); else { - zlog_warn( + flog_warn( + ZEBRA_ERR_UNKNOWN_FAMILY, "Invalid address family: %u received from kernel neighbor change: %u", ndm->ndm_family, h->nlmsg_type); return 0; |
