From 44e5b39fa2d21b5ea0374fc7566f5df20f7f24fb Mon Sep 17 00:00:00 2001 From: david Date: Tue, 30 Aug 2011 19:19:34 +0000 Subject: [PATCH] Don't fatal when failing to find an interface by index. --- libnetutil/netutil.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc index 639b88182..460c4a111 100644 --- a/libnetutil/netutil.cc +++ b/libnetutil/netutil.cc @@ -3130,8 +3130,11 @@ static int route_dst_generic(const struct sockaddr_storage *dst, assert(it != NULL); entry.intf_len = sizeof(entry); rc = intf_get_index(it, &entry, sin6->sin6_family, sin6->sin6_scope_id); - if (rc == -1) - netutil_fatal("Could not find interface with index %u", (unsigned int) sin6->sin6_scope_id); + if (rc == -1) { + intf_close(it); + netutil_error("Could not find interface with index %u", (unsigned int) sin6->sin6_scope_id); + return 0; + } intf_close(it); Strncpy(namebuf, entry.intf_name, sizeof(namebuf));