diff --git a/configure.in b/configure.in index 2fa474a3..3059d792 100644 --- a/configure.in +++ b/configure.in @@ -123,6 +123,8 @@ else ;; openbsd*) sysdesc=bsd ;; + dragonfly*) sysdesc=bsd + ;; *) AC_MSG_ERROR([Cannot determine correct system configuration. Please use --with-sysconfig to set it manually.]) ;; esac diff --git a/nest/neighbor.c b/nest/neighbor.c index bbd21330..ace216b2 100644 --- a/nest/neighbor.c +++ b/nest/neighbor.c @@ -113,7 +113,7 @@ neighbor * neigh_find2(struct proto *p, ip_addr *a, struct iface *ifa, unsigned flags) { neighbor *n; - int class, scope = -1; ; + int class, scope = -1; unsigned int h = neigh_hash(p, a); struct iface *i; @@ -239,7 +239,21 @@ neigh_down(neighbor *n) n->proto->neigh_notify(n); rem_node(&n->n); if (n->flags & NEF_STICKY) - add_tail(&sticky_neigh_list, &n->n); + { + add_tail(&sticky_neigh_list, &n->n); + + /* Respawn neighbor if there is another matching prefix */ + struct iface *i; + int scope; + + if (!n->iface) + WALK_LIST(i, iface_list) + if ((scope = if_connected(&n->addr, i)) >= 0) + { + neigh_up(n, i, scope); + return; + } + } else sl_free(neigh_slab, n); } diff --git a/sysdep/bsd/sysio.h b/sysdep/bsd/sysio.h index f0b5f401..4f91def5 100644 --- a/sysdep/bsd/sysio.h +++ b/sysdep/bsd/sysio.h @@ -6,6 +6,9 @@ * Can be freely distributed and used under the terms of the GNU GPL. */ +#ifdef __DragonFly__ +#define TCP_MD5SIG TCP_SIGNATURE_ENABLE +#endif #ifdef IPV6 static inline void diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index e1ac4524..7ec20723 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -113,13 +113,19 @@ kif_request_scan(void) tm_start(kif_scan_timer, 1); } -static inline int -prefer_scope(struct ifa *a, struct ifa *b) -{ return (a->scope > SCOPE_LINK) && (b->scope <= SCOPE_LINK); } - static inline int prefer_addr(struct ifa *a, struct ifa *b) -{ return ipa_compare(a->ip, b->ip) < 0; } +{ + int sa = a->scope > SCOPE_LINK; + int sb = b->scope > SCOPE_LINK; + + if (sa < sb) + return 0; + else if (sa > sb) + return 1; + else + return ipa_compare(a->ip, b->ip) < 0; +} static inline struct ifa * find_preferred_ifa(struct iface *i, ip_addr prefix, ip_addr mask) @@ -130,7 +136,7 @@ find_preferred_ifa(struct iface *i, ip_addr prefix, ip_addr mask) { if (!(a->flags & IA_SECONDARY) && ipa_equal(ipa_and(a->ip, mask), prefix) && - (!b || prefer_scope(a, b) || prefer_addr(a, b))) + (!b || prefer_addr(a, b))) b = a; }