void sig_handler(int sig) { int ret; if (sig == SIGUSR1) { mld_query_send(); return; } if (sig == SIGUSR2) { ret = iface_map_get(); if (ret < 0) goto exit; ret = iface_info_glue(); if (ret < 0) goto exit; pim_hello_send(NULL); return; } exit: running = 0; signals(SIG_IGN); pim_hello_send(NULL); }
/* RFC 4601: 4.3.1. Sending Hello Messages Thus, if a router needs to send a Join/Prune or Assert message on an interface on which it has not yet sent a Hello message with the currently configured IP address, then it MUST immediately send the relevant Hello message without waiting for the Hello Timer to expire, followed by the Join/Prune or Assert message. */ void pim_hello_restart_now(struct interface *ifp) { struct pim_interface *pim_ifp; zassert(ifp); pim_ifp = ifp->info; zassert(pim_ifp); /* * Reset next hello timer */ hello_resched(ifp); /* * Immediately send hello */ pim_hello_send(ifp, PIM_IF_DEFAULT_HOLDTIME(pim_ifp)); }
/* Periodic hello timer */ static int on_pim_hello_send(struct thread *t) { struct pim_interface *pim_ifp; struct interface *ifp; zassert(t); ifp = THREAD_ARG(t); zassert(ifp); pim_ifp = ifp->info; /* * Schedule next hello */ pim_ifp->t_pim_hello_timer = 0; hello_resched(ifp); /* * Send hello */ return pim_hello_send(ifp, PIM_IF_DEFAULT_HOLDTIME(pim_ifp)); }
void pim_sock_delete(struct interface *ifp, const char *delete_message) { zlog_info("PIM INTERFACE DOWN: on interface %s: %s", ifp->name, delete_message); if (!ifp->info) { zlog_err("%s: %s: but PIM not enabled on interface %s (!)", __PRETTY_FUNCTION__, delete_message, ifp->name); return; } /* RFC 4601: 4.3.1. Sending Hello Messages Before an interface goes down or changes primary IP address, a Hello message with a zero HoldTime should be sent immediately (with the old IP address if the IP address changed). */ pim_hello_send(ifp, 0 /* zero-sec holdtime */); pim_neighbor_delete_all(ifp, delete_message); sock_close(ifp); }