diff options
Diffstat (limited to 'zebra/if_netlink.c')
| -rw-r--r-- | zebra/if_netlink.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 184c5a4fa5..47a101e619 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -82,7 +82,7 @@ static void set_ifindex(struct interface *ifp, ifindex_t ifi_index, && (oifp != ifp)) { if (ifi_index == IFINDEX_INTERNAL) flog_err( - LIB_ERR_INTERFACE, + EC_LIB_INTERFACE, "Netlink is setting interface %s ifindex to reserved internal value %u", ifp->name, ifi_index); else { @@ -92,7 +92,7 @@ static void set_ifindex(struct interface *ifp, ifindex_t ifi_index, ifi_index, oifp->name, ifp->name); if (if_is_up(oifp)) flog_err( - LIB_ERR_INTERFACE, + EC_LIB_INTERFACE, "interface rename detected on up interface: index %d was renamed from %s to %s, results are uncertain!", ifi_index, oifp->name, ifp->name); if_delete_update(oifp); @@ -313,8 +313,8 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, vrf = vrf_get((vrf_id_t)ifi->ifi_index, name); // It would create vrf if (!vrf) { - flog_err(LIB_ERR_INTERFACE, "VRF %s id %u not created", - name, ifi->ifi_index); + flog_err(EC_LIB_INTERFACE, "VRF %s id %u not created", + name, ifi->ifi_index); return; } @@ -335,9 +335,9 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, /* Enable the created VRF. */ if (!vrf_enable(vrf)) { - flog_err(LIB_ERR_INTERFACE, - "Failed to enable VRF %s id %u", name, - ifi->ifi_index); + flog_err(EC_LIB_INTERFACE, + "Failed to enable VRF %s id %u", name, + ifi->ifi_index); return; } @@ -350,7 +350,7 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, vrf = vrf_lookup_by_id((vrf_id_t)ifi->ifi_index); if (!vrf) { - flog_warn(ZEBRA_ERR_VRF_NOT_FOUND, "%s: vrf not found", + flog_warn(EC_ZEBRA_VRF_NOT_FOUND, "%s: vrf not found", __func__); return; } @@ -900,9 +900,9 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup) if (ifa->ifa_family != AF_INET && ifa->ifa_family != AF_INET6) { flog_warn( - ZEBRA_ERR_UNKNOWN_FAMILY, - "Invalid address family: %u received from kernel interface addr change: %u", - ifa->ifa_family, h->nlmsg_type); + EC_ZEBRA_UNKNOWN_FAMILY, + "Invalid address family: %u received from kernel interface addr change: %s", + ifa->ifa_family, nl_msg_type_to_str(h->nlmsg_type)); return 0; } @@ -924,7 +924,7 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup) ifp = if_lookup_by_index_per_ns(zns, ifa->ifa_index); if (ifp == NULL) { flog_err( - LIB_ERR_INTERFACE, + EC_LIB_INTERFACE, "netlink_interface_addr can't find interface by index %d", ifa->ifa_index); return -1; @@ -1006,8 +1006,9 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup) if (ifa->ifa_family == AF_INET) { if (ifa->ifa_prefixlen > IPV4_MAX_BITLEN) { zlog_err( - "Invalid prefix length: %u received from kernel interface addr change: %u", - ifa->ifa_prefixlen, h->nlmsg_type); + "Invalid prefix length: %u received from kernel interface addr change: %s", + ifa->ifa_prefixlen, + nl_msg_type_to_str(h->nlmsg_type)); return -1; } if (h->nlmsg_type == RTM_NEWADDR) @@ -1022,8 +1023,9 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup) if (ifa->ifa_family == AF_INET6) { if (ifa->ifa_prefixlen > IPV6_MAX_BITLEN) { zlog_err( - "Invalid prefix length: %u received from kernel interface addr change: %u", - ifa->ifa_prefixlen, h->nlmsg_type); + "Invalid prefix length: %u received from kernel interface addr change: %s", + ifa->ifa_prefixlen, + nl_msg_type_to_str(h->nlmsg_type)); return -1; } if (h->nlmsg_type == RTM_NEWADDR) { @@ -1073,17 +1075,17 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) /* assume if not default zns, then new VRF */ if (!(h->nlmsg_type == RTM_NEWLINK || h->nlmsg_type == RTM_DELLINK)) { /* If this is not link add/delete message so print warning. */ - zlog_debug("netlink_link_change: wrong kernel message %d", - h->nlmsg_type); + zlog_debug("netlink_link_change: wrong kernel message %s", + nl_msg_type_to_str(h->nlmsg_type)); return 0; } if (!(ifi->ifi_family == AF_UNSPEC || ifi->ifi_family == AF_BRIDGE || ifi->ifi_family == AF_INET6)) { flog_warn( - ZEBRA_ERR_UNKNOWN_FAMILY, - "Invalid address family: %u received from kernel link change: %u", - ifi->ifi_family, h->nlmsg_type); + EC_ZEBRA_UNKNOWN_FAMILY, + "Invalid address family: %u received from kernel link change: %s", + ifi->ifi_family, nl_msg_type_to_str(h->nlmsg_type)); return 0; } |
