mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-17 08:38:42 +00:00
There may be more IP address records with the same IP.
This commit is contained in:
parent
5964569c23
commit
a506476acd
15
nest/iface.c
15
nest/iface.c
@ -451,6 +451,13 @@ ifa_recalc_all_primary_addresses(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
ifa_same(struct ifa *a, struct ifa *b)
|
||||||
|
{
|
||||||
|
return ipa_equal(a->ip, b->ip) && ipa_equal(a->prefix, b->prefix) &&
|
||||||
|
a->pxlen == b->pxlen;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ifa_update - update interface address
|
* ifa_update - update interface address
|
||||||
@ -467,11 +474,9 @@ ifa_update(struct ifa *a)
|
|||||||
struct ifa *b;
|
struct ifa *b;
|
||||||
|
|
||||||
WALK_LIST(b, i->addrs)
|
WALK_LIST(b, i->addrs)
|
||||||
if (ipa_equal(b->ip, a->ip))
|
if (ifa_same(b, a))
|
||||||
{
|
{
|
||||||
if (ipa_equal(b->prefix, a->prefix) &&
|
if (ipa_equal(b->brd, a->brd) &&
|
||||||
b->pxlen == a->pxlen &&
|
|
||||||
ipa_equal(b->brd, a->brd) &&
|
|
||||||
ipa_equal(b->opposite, a->opposite) &&
|
ipa_equal(b->opposite, a->opposite) &&
|
||||||
b->scope == a->scope &&
|
b->scope == a->scope &&
|
||||||
!((b->flags ^ a->flags) & IA_PEER))
|
!((b->flags ^ a->flags) & IA_PEER))
|
||||||
@ -514,7 +519,7 @@ ifa_delete(struct ifa *a)
|
|||||||
struct ifa *b;
|
struct ifa *b;
|
||||||
|
|
||||||
WALK_LIST(b, i->addrs)
|
WALK_LIST(b, i->addrs)
|
||||||
if (ipa_equal(b->ip, a->ip))
|
if (ifa_same(b, a))
|
||||||
{
|
{
|
||||||
rem_node(&b->n);
|
rem_node(&b->n);
|
||||||
if (b->flags & IF_UP)
|
if (b->flags & IF_UP)
|
||||||
|
Loading…
Reference in New Issue
Block a user