diff options
| author | David Lamparter <equinox@diac24.net> | 2018-08-28 18:13:24 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-28 18:13:24 +0200 | 
| commit | 9c42f07ccbe9534c48b7660640708da8cd371711 (patch) | |
| tree | c9d2fc7ed8d837ef3fa87e82f50583cbd417e71d | |
| parent | 9f0cf8f4354ce60d18501969115febdd3ba7ec1e (diff) | |
| parent | 5b4256ca42217a449b47987789d59e1729236535 (diff) | |
Merge pull request #2931 from donaldsharp/pim_zebra_crash
zebra: Fix crash in mroute debug
| -rw-r--r-- | zebra/rt_netlink.c | 12 | 
1 files changed, 7 insertions, 5 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index cab3f43b19..3683596b41 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -793,15 +793,17 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h,  			ifp = if_lookup_by_index(oif[count], vrf);  			char temp[256]; -			sprintf(temp, "%s ", ifp->name); +			sprintf(temp, "%s(%d) ", ifp ? ifp->name : "Unknown", +				oif[count]);  			strcat(oif_list, temp);  		}  		struct zebra_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 OIF: %s jiffies: %lld", -			zvrf->vrf->name, vrf, nl_msg_type_to_str(h->nlmsg_type), -			sbuf, gbuf, ifp->name, oif_list, m->lastused); +		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);  	}  	return 0;  }  | 
