diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-12-23 09:48:12 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-12-23 09:48:12 -0800 |
commit | 68a8a0db8666a7b5ea96047368ca480eb5f2ed09 (patch) | |
tree | 0e961ca3e81fea137e468c68e84140c9d303ca06 /zebra/rt_netlink.c | |
parent | 7c675262ade5fef3c49145dd9deca16210e3c95f (diff) | |
download | quagga-68a8a0db8666a7b5ea96047368ca480eb5f2ed09.tar.bz2 quagga-68a8a0db8666a7b5ea96047368ca480eb5f2ed09.tar.xz |
Add diagnostic messages
More messages in case of netlink errors, and debugging
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r-- | zebra/rt_netlink.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 8b65845e..a1fbb7c4 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -929,7 +929,10 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h) len = h->nlmsg_len - NLMSG_LENGTH (sizeof (struct ifinfomsg)); if (len < 0) - return -1; + { + zlog_err ("%s: truncated netlink message", __func__); + return -1; + } /* Looking up interface name. */ memset (tb, 0, sizeof tb); @@ -957,8 +960,11 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h) { unsigned long new_flags = ifi->ifi_flags & 0x0000fffff; unsigned int mtu = *(uint32_t *) RTA_DATA (tb[IFLA_MTU]); - ifp = if_lookup_by_index (ifi->ifi_index); + if (IS_ZEBRA_DEBUG_KERNEL) + zlog_debug ("%s: new link flags %#lx mtu %d", __func__, new_flags, mtu); + + ifp = if_lookup_by_index (ifi->ifi_index); if (ifp == NULL || !CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE)) { if (ifp == NULL) |