summaryrefslogtreecommitdiff
path: root/proto/ospf/neighbor.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2020-05-01 15:34:17 +0200
committerMaria Matejka <mq@ucw.cz>2020-05-01 15:34:17 +0200
commit048eb2ddf1ee9587d9fa30cbb3f87d6f650a2133 (patch)
treefdec4c5679a02c901cf2bc92fd81618c6f12d48e /proto/ospf/neighbor.c
parent17de3a023f7bde293892b41bfafe5740c8553fc8 (diff)
parent59238768b3b05fa134348d2232b42537d0403994 (diff)
Merge remote-tracking branch 'origin/mq-static-analysis'
Diffstat (limited to 'proto/ospf/neighbor.c')
-rw-r--r--proto/ospf/neighbor.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c
index 30e80640..18692d6e 100644
--- a/proto/ospf/neighbor.c
+++ b/proto/ospf/neighbor.c
@@ -650,19 +650,20 @@ void
ospf_dr_election(struct ospf_iface *ifa)
{
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;
DBG("(B)DR election.\n");
- me.state = NEIGHBOR_2WAY;
- me.rid = myid;
- me.priority = ifa->priority;
- me.ip = ifa->addr->ip;
-
- me.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;
- me.iface_id = ifa->iface_id;
+ struct ospf_neighbor me = {
+ .state = NEIGHBOR_2WAY,
+ .rid = myid,
+ .priority = ifa->priority,
+ .ip = ifa->addr->ip,
+ .dr = ospf_is_v2(p) ? ipa_to_u32(ifa->drip) : ifa->drid,
+ .bdr = ospf_is_v2(p) ? ipa_to_u32(ifa->bdrip) : ifa->bdrid,
+ .iface_id = ifa->iface_id,
+ };
add_tail(&ifa->neigh_list, NODE & me);