diff options
Diffstat (limited to 'ospfd/ospf_packet.c')
| -rw-r--r-- | ospfd/ospf_packet.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 57643f637e..b22fe5d99b 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -1169,8 +1169,8 @@ static void ospf_db_desc_proc(struct stream *s, struct ospf_interface *oi, if (IS_OPAQUE_LSA(lsah->type) && !CHECK_FLAG(nbr->options, OSPF_OPTION_O)) { flog_warn(EC_OSPF_PACKET, - "LSA[Type%d:%pI4]: Opaque capability mismatch?", - lsah->type, &lsah->id); + "LSA[Type%d:%pI4] from %pI4: Opaque capability mismatch?", + lsah->type, &lsah->id, &lsah->adv_router); OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_SeqNumberMismatch); return; } @@ -1716,6 +1716,12 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr, break; } + if (length < OSPF_LSA_HEADER_SIZE) { + flog_warn(EC_OSPF_PACKET, + "Link State Update: LSA length too small."); + break; + } + /* Validate the LSA's LS checksum. */ sum = lsah->checksum; if (!ospf_lsa_checksum_valid(lsah)) { @@ -1781,9 +1787,10 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr, continue; } } else if (IS_OPAQUE_LSA(lsah->type)) { - flog_warn(EC_OSPF_PACKET, - "LSA[Type%d:%pI4]: Opaque capability mismatch?", - lsah->type, &lsah->id); + flog_warn( + EC_OSPF_PACKET, + "LSA[Type%d:%pI4] from %pI4: Opaque capability mismatch?", + lsah->type, &lsah->id, &lsah->adv_router); continue; } @@ -4220,7 +4227,8 @@ static void ospf_ls_ack_send_list(struct ospf_interface *oi, struct list *ack, op->length = length; /* Decide destination address. */ - if (oi->type == OSPF_IFTYPE_POINTOPOINT) + if (oi->type == OSPF_IFTYPE_POINTOPOINT || + oi->type == OSPF_IFTYPE_POINTOMULTIPOINT) op->dst.s_addr = htonl(OSPF_ALLSPFROUTERS); else op->dst.s_addr = dst.s_addr; |
