diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2019-07-12 21:40:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-12 21:40:50 +0200 |
commit | 6b0be3df1f7fb81dd05ae84f7ef935b7b8ebd161 (patch) | |
tree | 5e81f034fc4518241cb5cce35ba31cb707d77623 | |
parent | Merge pull request #4325 from sworleys/Order-Recv-Nexthops (diff) | |
parent | zebra: Add a conditional guard if zvrf lookup fail (diff) | |
download | frr-6b0be3df1f7fb81dd05ae84f7ef935b7b8ebd161.tar.xz frr-6b0be3df1f7fb81dd05ae84f7ef935b7b8ebd161.zip |
Merge pull request #4664 from sworleys/Zvrf-Debug-Guard
zebra: Add a conditional guard if zvrf lookup fail
-rw-r--r-- | zebra/rt_netlink.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index f951738b7..b1d0c1e3a 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -811,7 +811,9 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h, } if (IS_ZEBRA_DEBUG_KERNEL) { - struct interface *ifp; + struct interface *ifp = NULL; + struct zebra_vrf *zvrf = NULL; + strlcpy(sbuf, inet_ntoa(m->sg.src), sizeof(sbuf)); strlcpy(gbuf, inet_ntoa(m->sg.grp), sizeof(gbuf)); for (count = 0; count < oif_count; count++) { @@ -822,13 +824,14 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h, oif[count]); strlcat(oif_list, temp, sizeof(oif_list)); } - struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(vrf); + zvrf = zebra_vrf_lookup_by_id(vrf); ifp = if_lookup_by_index(iif, vrf); - zlog_debug("MCAST VRF: %s(%d) %s (%s,%s) IIF: %s(%d) OIF: %s jiffies: %lld", - zvrf->vrf->name, vrf, - nl_msg_type_to_str(h->nlmsg_type), - sbuf, gbuf, ifp ? ifp->name : "Unknown", iif, - oif_list, m->lastused); + zlog_debug( + "MCAST VRF: %s(%d) %s (%s,%s) IIF: %s(%d) OIF: %s jiffies: %lld", + (zvrf ? zvrf->vrf->name : "Unknown"), vrf, + nl_msg_type_to_str(h->nlmsg_type), sbuf, gbuf, + ifp ? ifp->name : "Unknown", iif, oif_list, + m->lastused); } return 0; } |