From 62e64905b76b88da72c522eac9276a74f60c9592 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Mon, 20 Feb 2017 02:26:45 +0100 Subject: Several minor fixes --- proto/ospf/rt.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'proto/ospf/rt.c') diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index 74f47810..1b0ac5e9 100644 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@ -36,11 +36,9 @@ unresolved_vlink(ort *ort) static inline struct nexthop * new_nexthop(struct ospf_proto *p, ip_addr gw, struct iface *iface, byte weight) { - struct nexthop *nh = lp_alloc(p->nhpool, sizeof(struct nexthop)); - nh->labels = 0; + struct nexthop *nh = lp_allocz(p->nhpool, sizeof(struct nexthop)); nh->gw = gw; nh->iface = iface; - nh->next = NULL; nh->weight = weight; return nh; } @@ -1907,7 +1905,6 @@ ort_changed(ort *nf, rta *nr) (nf->n.metric1 != nf->old_metric1) || (nf->n.metric2 != nf->old_metric2) || (nf->n.tag != nf->old_tag) || (nf->n.rid != nf->old_rid) || (nr->source != or->source) || (nr->dest != or->dest) || - (nr->nh.iface != or->nh.iface) || !ipa_equal(nr->nh.gw, or->nh.gw) || !nexthop_same(&(nr->nh), &(or->nh)); } @@ -1952,11 +1949,10 @@ again1: .src = p->p.main_source, .source = nf->n.type, .scope = SCOPE_UNIVERSE, + .dest = RTD_UNICAST, + .nh = *(nf->n.nhs), }; - nexthop_link(&a0, nf->n.nhs); - a0.dest = RTD_UNICAST; - if (reload || ort_changed(nf, &a0)) { rta *a = rta_lookup(&a0); -- cgit v1.2.3