0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-08 12:18:42 +00:00

Create default net based on adress type

This commit is contained in:
Igor Putovny 2024-03-07 15:32:58 +01:00
parent e468296355
commit 5cb2e20f4d

View File

@ -1539,9 +1539,20 @@ aggregator_start(struct proto *P)
.data = p,
};
struct network *default_net = mb_alloc(P->pool, sizeof(struct network) + sizeof(struct net_addr_ip4));
net_fill_ip4(default_net->n.addr, IP4_NONE, 0);
log("Creating net %p for default route", default_net);
struct network *default_net = NULL;
if (p->addr_type == NET_IP4)
{
default_net = mb_alloc(P->pool, sizeof(struct network) + sizeof(struct net_addr_ip4));
net_fill_ip4(default_net->n.addr, IP4_NONE, 0);
log("Creating net %p for default route", default_net);
}
else if (p->addr_type == NET_IP6)
{
default_net = mb_alloc(P->pool, sizeof(struct network) + sizeof(struct net_addr_ip6));
net_fill_ip6(default_net->n.addr, IP6_NONE, 0);
log("Creating net %p for default route", default_net);
}
/* Create route attributes with zero nexthop */
struct rta rta = { 0 };