diff --git a/nest/rt-table.c b/nest/rt-table.c index 2606fd14..c8d0c1f7 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -643,6 +643,7 @@ rte_recalculate(struct announce_hook *ah, net *net, rte *new, ea_list *tmpa, str struct proto *p = ah->proto; struct rtable *table = ah->table; struct proto_stats *stats = ah->stats; + static struct rate_limit rl_pipe; rte *before_old = NULL; rte *old_best = net->routes; rte *old = NULL; @@ -666,7 +667,7 @@ rte_recalculate(struct announce_hook *ah, net *net, rte *new, ea_list *tmpa, str { if (new) { - log(L_ERR "Pipe collision detected when sending %F to table %s", + log_rl(&rl_pipe, L_ERR "Pipe collision detected when sending %F to table %s", &net->n, table->name); rte_free_quick(new); } @@ -1335,6 +1336,7 @@ rt_init(void) static inline int rt_prune_step(rtable *tab, int step, int *max_feed) { + static struct rate_limit rl_flush; struct fib_iterator *fit = &tab->prune_fit; DBG("Pruning route table %s\n", tab->name); @@ -1369,7 +1371,7 @@ again: } if (step) - log(L_WARN "Route %I/%d from %s still in %s after flush", + log_rl(&rl_flush, L_WARN "Route %I/%d from %s still in %s after flush", n->n.prefix, n->n.pxlen, e->attrs->proto->name, tab->name); rte_discard(tab, e); diff --git a/sysdep/cf/bsd-v6.h b/sysdep/cf/bsd-v6.h index 3403299f..47a7c7ff 100644 --- a/sysdep/cf/bsd-v6.h +++ b/sysdep/cf/bsd-v6.h @@ -13,6 +13,7 @@ #define CONFIG_MULTIPLE_TABLES #define CONFIG_SKIP_MC_BIND +#define CONFIG_NO_IFACE_BIND /* Link: sysdep/unix diff --git a/sysdep/cf/bsd.h b/sysdep/cf/bsd.h index 1101b228..5e6d03e8 100644 --- a/sysdep/cf/bsd.h +++ b/sysdep/cf/bsd.h @@ -11,6 +11,7 @@ #define CONFIG_MULTIPLE_TABLES #define CONFIG_SKIP_MC_BIND +#define CONFIG_NO_IFACE_BIND /* Link: sysdep/unix diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 3fe0fedf..41dfc23a 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -1262,6 +1262,15 @@ sk_open(sock *s) int one = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) ERR("SO_REUSEADDR"); + +#ifdef CONFIG_NO_IFACE_BIND + /* Workaround missing ability to bind to an iface */ + if ((type == SK_UDP) && s->iface && ipa_zero(s->saddr)) + { + if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)) < 0) + ERR("SO_REUSEPORT"); + } +#endif } sockaddr_fill(sa, s->saddr, s->iface, port);