0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-10-18 09:58:43 +00:00

Merge commit '0343d066dab077d1391640c53198199b16bef993' into integrated

This commit is contained in:
Ondrej Zajicek 2013-01-12 23:40:00 +01:00
commit debc0e45fd
4 changed files with 33 additions and 8 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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

View File

@ -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;
}