respondd: the iface info is only inserted if if_nametoindex() was successful
This commit is contained in:
parent
9198ad056d
commit
108f0846d6
|
@ -621,14 +621,17 @@ int main(int argc, char **argv) {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert the interface delay info at the beginning of the list
|
if (last_ifindex) {
|
||||||
struct interface_delay_info **head = &if_delay_info_list;
|
// insert the interface delay info at the beginning of the list
|
||||||
struct interface_delay_info *old_head = if_delay_info_list;
|
struct interface_delay_info **head = &if_delay_info_list;
|
||||||
|
struct interface_delay_info *old_head = if_delay_info_list;
|
||||||
|
|
||||||
|
*head = malloc(sizeof(*if_delay_info_list));
|
||||||
|
(*head)->ifindex = last_ifindex;
|
||||||
|
(*head)->max_multicast_delay = max_multicast_delay;
|
||||||
|
(*head)->next = old_head;
|
||||||
|
}
|
||||||
|
|
||||||
*head = malloc(sizeof(*if_delay_info_list));
|
|
||||||
(*head)->ifindex = last_ifindex;
|
|
||||||
(*head)->max_multicast_delay = max_multicast_delay;
|
|
||||||
(*head)->next = old_head;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue