summaryrefslogtreecommitdiff
path: root/proto/ospf/lsreq.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2014-10-24 10:27:21 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2014-10-24 11:07:38 +0200
commitf8fefde318c6248ad94e7b6d60155deed9ab8eed (patch)
tree4edd3eb9b152f016afc2482555fb62b04f96eeb2 /proto/ospf/lsreq.c
parent78342404ff573e85e396f0611014b90cea9b4c0a (diff)
Refactoring of OSPF messages.
Diffstat (limited to 'proto/ospf/lsreq.c')
-rw-r--r--proto/ospf/lsreq.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/proto/ospf/lsreq.c b/proto/ospf/lsreq.c
index a6c0cf24..067ad79b 100644
--- a/proto/ospf/lsreq.c
+++ b/proto/ospf/lsreq.c
@@ -93,7 +93,7 @@ ospf_send_lsreq(struct ospf_proto *p, struct ospf_neighbor *n)
length = ospf_pkt_hdrlen(p) + i * sizeof(struct ospf_lsreq_header);
pkt->length = htons(length);
- OSPF_PACKET(ospf_dump_lsreq, pkt, "LSREQ packet sent to %I via %s", n->ip, ifa->ifname);
+ OSPF_PACKET(ospf_dump_lsreq, pkt, "LSREQ packet sent to nbr %R on %s", n->rid, ifa->ifname);
ospf_send_to(ifa, n->ip);
}
@@ -110,10 +110,13 @@ ospf_receive_lsreq(struct ospf_packet *pkt, struct ospf_iface *ifa,
/* No need to check length, lsreq has only basic header */
- OSPF_PACKET(ospf_dump_lsreq, pkt, "LSREQ packet received from %I via %s", n->ip, ifa->ifname);
+ OSPF_PACKET(ospf_dump_lsreq, pkt, "LSREQ packet received from nbr %R on %s", n->rid, ifa->ifname);
if (n->state < NEIGHBOR_EXCHANGE)
+ {
+ OSPF_TRACE(D_PACKETS, "LSREQ packet ignored - lesser state than Exchange");
return;
+ }
ospf_neigh_sm(n, INM_HELLOREC); /* Not in RFC */
@@ -134,8 +137,9 @@ ospf_receive_lsreq(struct ospf_packet *pkt, struct ospf_iface *ifa,
en = ospf_hash_find(p->gr, domain, id, rt, type);
if (!en)
{
- log(L_WARN "%s: Received LSREQ from %I for missing LSA (Type: %04x, Id: %R, Rt: %R)",
- p->p.name, n->ip, type, id, rt);
+ LOG_LSA1("Bad LSR (Type: %04x, Id: %R, Rt: %R) in LSREQ", type, id, rt);
+ LOG_LSA2(" received from nbr %R on %s - LSA is missing", n->rid, ifa->ifname);
+
ospf_neigh_sm(n, INM_BADLSREQ);
return;
}