From de9f84d080d358e6292e220b8fc0cc467745972f Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 28 Sep 2022 21:40:57 +0000 Subject: [PATCH] Get better error message. See #2179 --- libnetutil/netutil.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc index 56757e236..85afde390 100644 --- a/libnetutil/netutil.cc +++ b/libnetutil/netutil.cc @@ -3194,7 +3194,8 @@ static int route_dst_netlink(const struct sockaddr_storage *dst, intf_index = *(int *) RTA_DATA(rtattr); p = if_indextoname(intf_index, namebuf); - assert(p != NULL); + if (p == NULL) + netutil_fatal("%s: if_indextoname(%d) failed: %d (%s)", __func__, intf_index, errno, strerror(errno)); ii = getInterfaceByName(namebuf, dst->ss_family); if (ii == NULL) ii = getInterfaceByName(namebuf, AF_UNSPEC);