0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-01-09 02:21:54 +00:00

OSPF: Zero-initialization of a temporary neighbor

This commit is contained in:
Maria Matejka 2019-08-17 10:28:55 +02:00
parent 4f81a9035a
commit 14d6f6d75c

View File

@ -652,19 +652,20 @@ void
ospf_dr_election(struct ospf_iface *ifa) ospf_dr_election(struct ospf_iface *ifa)
{ {
struct ospf_proto *p = ifa->oa->po; struct ospf_proto *p = ifa->oa->po;
struct ospf_neighbor *neigh, *ndr, *nbdr, me; struct ospf_neighbor *neigh, *ndr, *nbdr;
u32 myid = p->router_id; u32 myid = p->router_id;
DBG("(B)DR election.\n"); DBG("(B)DR election.\n");
me.state = NEIGHBOR_2WAY; struct ospf_neighbor me = {
me.rid = myid; .state = NEIGHBOR_2WAY,
me.priority = ifa->priority; .rid = myid,
me.ip = ifa->addr->ip; .priority = ifa->priority,
.ip = ifa->addr->ip,
me.dr = ospf_is_v2(p) ? ipa_to_u32(ifa->drip) : ifa->drid; .dr = ospf_is_v2(p) ? ipa_to_u32(ifa->drip) : ifa->drid,
me.bdr = ospf_is_v2(p) ? ipa_to_u32(ifa->bdrip) : ifa->bdrid; .bdr = ospf_is_v2(p) ? ipa_to_u32(ifa->bdrip) : ifa->bdrid,
me.iface_id = ifa->iface_id; .iface_id = ifa->iface_id,
};
add_tail(&ifa->neigh_list, NODE & me); add_tail(&ifa->neigh_list, NODE & me);