mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-22 06:17:04 +00:00
Merge commit 'd40c26594c22ad934a13061e11b373bdf81af8f9' into integrated
Conflicts: proto/static/static.c
This commit is contained in:
commit
6c58962611
@ -58,7 +58,7 @@ p_igp_table(struct proto *p)
|
|||||||
static void
|
static void
|
||||||
static_install(struct proto *p, struct static_route *r, struct iface *ifa)
|
static_install(struct proto *p, struct static_route *r, struct iface *ifa)
|
||||||
{
|
{
|
||||||
if (r->installed)
|
if (r->installed > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DBG("Installing static route %I/%d, rtd=%d\n", r->net, r->masklen, r->dest);
|
DBG("Installing static route %I/%d, rtd=%d\n", r->net, r->masklen, r->dest);
|
||||||
@ -122,7 +122,7 @@ static_remove(struct proto *p, struct static_route *r)
|
|||||||
if (!r->installed)
|
if (!r->installed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DBG("Removing static route %I/%d\n", r->net, r->masklen);
|
DBG("Removing static route %I/%d via %I\n", r->net, r->masklen, r->via);
|
||||||
|
|
||||||
// int pxlen = r->masklen + (ipa_is_ip4(r->net) ? 96 : 0); // XXXX: Hack
|
// int pxlen = r->masklen + (ipa_is_ip4(r->net) ? 96 : 0); // XXXX: Hack
|
||||||
net *n = net_find(p->table, r->net, r->masklen);
|
net *n = net_find(p->table, r->net, r->masklen);
|
||||||
@ -419,19 +419,24 @@ static_match(struct proto *p, struct static_route *r, struct static_config *n)
|
|||||||
|
|
||||||
if (r->neigh)
|
if (r->neigh)
|
||||||
r->neigh->data = NULL;
|
r->neigh->data = NULL;
|
||||||
|
|
||||||
WALK_LIST(t, n->iface_routes)
|
WALK_LIST(t, n->iface_routes)
|
||||||
if (static_same_net(r, t))
|
if (static_same_net(r, t))
|
||||||
{
|
goto found;
|
||||||
t->installed = r->installed && static_same_dest(r, t);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
WALK_LIST(t, n->other_routes)
|
WALK_LIST(t, n->other_routes)
|
||||||
if (static_same_net(r, t))
|
if (static_same_net(r, t))
|
||||||
{
|
goto found;
|
||||||
t->installed = r->installed && static_same_dest(r, t);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
static_remove(p, r);
|
static_remove(p, r);
|
||||||
|
return;
|
||||||
|
|
||||||
|
found:
|
||||||
|
/* If destination is different, force reinstall */
|
||||||
|
if ((r->installed > 0) && !static_same_dest(r, t))
|
||||||
|
t->installed = -1;
|
||||||
|
else
|
||||||
|
t->installed = r->installed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline rtable *
|
static inline rtable *
|
||||||
|
@ -31,7 +31,7 @@ struct static_route {
|
|||||||
struct neighbor *neigh;
|
struct neighbor *neigh;
|
||||||
byte *if_name; /* Name for RTD_DEVICE routes */
|
byte *if_name; /* Name for RTD_DEVICE routes */
|
||||||
struct static_route *mp_next; /* Nexthops for RTD_MULTIPATH routes */
|
struct static_route *mp_next; /* Nexthops for RTD_MULTIPATH routes */
|
||||||
int installed; /* Installed in master table */
|
int installed; /* Installed in rt table, -1 for reinstall */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Dummy nodes (parts of multipath route) abuses masklen field for weight
|
/* Dummy nodes (parts of multipath route) abuses masklen field for weight
|
||||||
|
Loading…
x
Reference in New Issue
Block a user