respondd: the iface info is only inserted if if_nametoindex() was successful

This commit is contained in:
lemoer 2016-12-01 01:09:49 +01:00
parent 9198ad056d
commit 108f0846d6
1 changed files with 10 additions and 7 deletions

View File

@ -621,6 +621,7 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
if (last_ifindex) {
// insert the interface delay info at the beginning of the list
struct interface_delay_info **head = &if_delay_info_list;
struct interface_delay_info *old_head = if_delay_info_list;
@ -629,6 +630,8 @@ int main(int argc, char **argv) {
(*head)->ifindex = last_ifindex;
(*head)->max_multicast_delay = max_multicast_delay;
(*head)->next = old_head;
}
break;