diff --git a/net/respondd/src/respondd.c b/net/respondd/src/respondd.c index 3be8731..47cf6e2 100644 --- a/net/respondd/src/respondd.c +++ b/net/respondd/src/respondd.c @@ -621,14 +621,17 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - // 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; + 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; + + *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;