OSPF: Zero-initialization of a temporary neighbor
This commit is contained in:
parent
0fa8bf91cd
commit
a7d9b8f116
1 changed files with 10 additions and 9 deletions
|
@ -650,19 +650,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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue