{
char buf[RX_BUFF_SIZE];
struct sockaddr_storage from;
- fromlen = sizeof from;
+ if (rb != NULL)
+ freerecvbuf(rb);
+
+ fromlen = sizeof(from);
buflen = recvfrom(fd, buf, sizeof(buf), 0,
(struct sockaddr*)&from, &fromlen);
-#ifdef DEBUG
- if (debug > 3)
- printf("%s on (%lu) fd=%d from %s\n",
+ DPRINTF(4, ("%s on (%lu) fd=%d from %s\n",
(itf->ignore_packets == ISC_TRUE) ? "ignore" : "drop",
free_recvbuffs(), fd,
- stoa(&from));
-#endif
+ stoa(&from)));
if (itf->ignore_packets == ISC_TRUE)
packets_ignored++;
else
*/
if (rl6 != 0 &&
!IN6_IS_ADDR_UNSPECIFIED(&rl6->addr6)
- && !(rl6->mflags & RESM_INTERFACE)) {
+ && !(rl6->mflags & RESM_INTERFACE && op != RESTRICT_REMOVEIF)) {
- rlprev6->next = rl6->next;
+ if (rlprev6) {
+ rlprev6->next = rl6->next;
+ } else {
+ restrictlist6 = rl6->next;
+ }
restrictcount6--;
if (rl6->flags & RES_LIMITED) {
res_limited_refcnt6--;
*/
static u_long adjust_timer; /* second timer */
static u_long keys_timer; /* minute timer */
- static u_long hourly_timer; /* hour timer */
+ static u_long stats_timer; /* stats timer */
static u_long huffpuff_timer; /* huff-n'-puff timer */
+static u_long interface_timer; /* interface update timer */
#ifdef OPENSSL
static u_long revoke_timer; /* keys revoke timer */
u_char sys_revoke = KEY_REVOKE; /* keys revoke timeout (log2 s) */
alarm_flag = 0;
alarm_overflow = 0;
adjust_timer = 1;
- hourly_timer = HOUR;
+ stats_timer = 0;
huffpuff_timer = 0;
+ interface_timer = 0;
current_time = 0;
timer_overflows = 0;
timer_xmtcalls = 0;
}
#endif /* OPENSSL */
+ /*
+ * interface update timer
+ */
+ if (interface_interval && interface_timer <= current_time) {
+ timer_interfacetimeout(current_time + interface_interval);
+#ifdef DEBUG
+ if (debug)
+ printf("timer: interface update\n");
+#endif
+ interface_update(NULL, NULL);
+ }
+
/*
- * Finally, call the hourly routine.
+ * Finally, periodically write stats.
*/
- if (hourly_timer <= current_time) {
- hourly_timer += HOUR;
- hourly_stats();
+ if (stats_timer <= current_time) {
+ if (stats_timer != 0)
+ write_stats();
+ stats_timer += stats_write_period;
}
}