From 1647923bd8d2f8e53337365abc5be7e343aa570c Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Sun, 9 May 2021 14:51:39 +0200 Subject: OSPF: Minor refactoring of packet sending code Common behavior for LSupd and delayed LSack moved to ospf_send_to_iface() and other minor changes. --- proto/ospf/lsack.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'proto/ospf/lsack.c') diff --git a/proto/ospf/lsack.c b/proto/ospf/lsack.c index 5318e50c..1654953f 100644 --- a/proto/ospf/lsack.c +++ b/proto/ospf/lsack.c @@ -111,20 +111,12 @@ ospf_send_lsack_(struct ospf_proto *p, struct ospf_neighbor *n, int queue) { OSPF_PACKET(ospf_dump_lsack, pkt, "LSACK packet sent to nbr %R on %s", n->rid, ifa->ifname); ospf_send_to(ifa, n->ip); - return; } - - OSPF_PACKET(ospf_dump_lsack, pkt, "LSACK packet sent via %s", ifa->ifname); - - if (ifa->type == OSPF_IT_BCAST) + else { - if ((ifa->state == OSPF_IS_DR) || (ifa->state == OSPF_IS_BACKUP)) - ospf_send_to_all(ifa); - else - ospf_send_to_des(ifa); + OSPF_PACKET(ospf_dump_lsack, pkt, "LSACK packet sent via %s", ifa->ifname); + ospf_send_to_iface(ifa); } - else - ospf_send_to_agt(ifa, NEIGHBOR_EXCHANGE); } void -- cgit v1.2.3