summaryrefslogtreecommitdiff
path: root/zebra/if_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/if_netlink.c')
-rw-r--r--zebra/if_netlink.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index 0dcf5082a2..588f1259cf 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -67,6 +67,7 @@
#include "zebra/zebra_mpls.h"
#include "zebra/kernel_netlink.h"
#include "zebra/if_netlink.h"
+#include "zebra/zebra_errors.h"
extern struct zebra_privs_t zserv_privs;
@@ -112,8 +113,8 @@ static void netlink_interface_update_hw_addr(struct rtattr **tb,
hw_addr_len = RTA_PAYLOAD(tb[IFLA_ADDRESS]);
if (hw_addr_len > INTERFACE_HWADDR_MAX)
- zlog_warn("Hardware address is too large: %d",
- hw_addr_len);
+ zlog_debug("Hardware address is too large: %d",
+ hw_addr_len);
else {
ifp->hw_addr_len = hw_addr_len;
memcpy(ifp->hw_addr, RTA_DATA(tb[IFLA_ADDRESS]),
@@ -349,7 +350,8 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb,
vrf = vrf_lookup_by_id((vrf_id_t)ifi->ifi_index);
if (!vrf) {
- zlog_warn("%s: vrf not found", __func__);
+ flog_warn(ZEBRA_ERR_VRF_NOT_FOUND, "%s: vrf not found",
+ __func__);
return;
}
@@ -531,7 +533,8 @@ static int netlink_bridge_interface(struct nlmsghdr *h, int len, ns_id_t ns_id,
/* The interface should already be known, if not discard. */
ifp = if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id), ifi->ifi_index);
if (!ifp) {
- zlog_warn("Cannot find bridge IF %s(%u)", name, ifi->ifi_index);
+ zlog_debug("Cannot find bridge IF %s(%u)", name,
+ ifi->ifi_index);
return 0;
}
if (!IS_ZEBRA_IF_VXLAN(ifp))
@@ -896,7 +899,8 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup)
ifa = NLMSG_DATA(h);
if (ifa->ifa_family != AF_INET && ifa->ifa_family != AF_INET6) {
- zlog_warn(
+ flog_warn(
+ ZEBRA_ERR_UNKNOWN_FAMILY,
"Invalid address family: %u received from kernel interface addr change: %u",
ifa->ifa_family, h->nlmsg_type);
return 0;
@@ -1130,14 +1134,15 @@ 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_warn("netlink_link_change: wrong kernel message %d",
- h->nlmsg_type);
+ zlog_debug("netlink_link_change: wrong kernel message %d",
+ h->nlmsg_type);
return 0;
}
if (!(ifi->ifi_family == AF_UNSPEC || ifi->ifi_family == AF_BRIDGE
|| ifi->ifi_family == AF_INET6)) {
- zlog_warn(
+ flog_warn(
+ ZEBRA_ERR_UNKNOWN_FAMILY,
"Invalid address family: %u received from kernel link change: %u",
ifi->ifi_family, h->nlmsg_type);
return 0;
@@ -1248,7 +1253,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
set_ifindex(ifp, ifi->ifi_index, zns);
ifp->flags = ifi->ifi_flags & 0x0000fffff;
if (!tb[IFLA_MTU]) {
- zlog_warn(
+ zlog_debug(
"RTM_NEWLINK for interface %s(%u) without MTU set",
name, ifi->ifi_index);
return 0;
@@ -1303,7 +1308,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
set_ifindex(ifp, ifi->ifi_index, zns);
if (!tb[IFLA_MTU]) {
- zlog_warn(
+ zlog_debug(
"RTM_NEWLINK for interface %s(%u) without MTU set",
name, ifi->ifi_index);
return 0;
@@ -1359,8 +1364,10 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
} else {
/* Delete interface notification from kernel */
if (ifp == NULL) {
- zlog_warn("RTM_DELLINK for unknown interface %s(%u)",
- name, ifi->ifi_index);
+ if (IS_ZEBRA_DEBUG_KERNEL)
+ zlog_debug(
+ "RTM_DELLINK for unknown interface %s(%u)",
+ name, ifi->ifi_index);
return 0;
}