Revision 6f8bbaa1 proto/ospf/dbdes.c

View differences:

proto/ospf/dbdes.c
212 212

  
213 213
  ospf_prepare_dbdes(p, n);
214 214
  ospf_do_send_dbdes(p, n);
215

  
216
  if (n->state == NEIGHBOR_EXSTART)
217
    return;
218

  
219
  /* Master should restart RXMT timer for each DBDES exchange */
220
  if (n->myimms & DBDES_MS)
221
    tm_start(n->rxmt_timer, n->ifa->rxmtint);
222

  
223
  if (!(n->myimms & DBDES_MS))
224
    if (!(n->myimms & DBDES_M) && !(n->imms & DBDES_M))
225
      ospf_neigh_sm(n, INM_EXDONE);
226 215
}
227 216

  
228 217
void
......
277 266
    en = ospf_hash_find(p->gr, lsa_domain, lsa.id, lsa.rt, lsa_type);
278 267
    if (!en || (lsa_comp(&lsa, &(en->lsa)) == CMP_NEWER))
279 268
    {
269
      /* This should be splitted to ospf_lsa_lsrq_up() */
280 270
      req = ospf_hash_get(n->lsrqh, lsa_domain, lsa.id, lsa.rt, lsa_type);
281 271

  
282 272
      if (!SNODE_VALID(req))
283 273
	s_add_tail(&n->lsrql, SNODE req);
284 274

  
275
      if (!SNODE_VALID(n->lsrqi))
276
	n->lsrqi = req;
277

  
285 278
      req->lsa = lsa;
286 279
      req->lsa_body = LSA_BODY_DUMMY;
280

  
281
      if (!tm_active(n->lsrq_timer))
282
	tm_start(n->lsrq_timer, 0);
287 283
    }
288 284
  }
289 285

  
......
306 302
  u32 rcv_ddseq, rcv_options;
307 303
  u16 rcv_iface_mtu;
308 304
  u8 rcv_imms;
309
  uint plen, err_val = 0, err_seqmis = 0;
305
  uint plen, err_val = 0;
310 306

  
311 307
  /* RFC 2328 10.6 */
312 308

  
313 309
  plen = ntohs(pkt->length);
314 310
  if (plen < ospf_dbdes_hdrlen(p))
315
    DROP("too short", plen);
311
  {
312
    LOG_PKT("Bad DBDES packet from nbr %R on %s - %s (%u)", n->rid, ifa->ifname, "too short", plen);
313
    return;
314
  }
316 315

  
317 316
  OSPF_PACKET(ospf_dump_dbdes, pkt, "DBDES packet received from nbr %R on %s", n->rid, ifa->ifname);
318 317

  
......
366 365
      n->options = rcv_options;
367 366
      n->myimms &= ~DBDES_MS;
368 367
      n->imms = rcv_imms;
368
      tm_stop(n->dbdes_timer);
369 369
      ospf_neigh_sm(n, INM_NEGDONE);
370 370
      ospf_send_dbdes(p, n);
371 371
      break;
......
381 381
      n->ddr = rcv_ddseq - 1;	/* It will be set corectly a few lines down */
382 382
      n->imms = rcv_imms;
383 383
      ospf_neigh_sm(n, INM_NEGDONE);
384
      /* Continue to the NEIGHBOR_EXCHANGE case */
384 385
    }
385 386
    else
386 387
    {
......
394 395
	(rcv_ddseq == n->ddr))
395 396
      goto duplicate;
396 397

  
397
    /* Do INM_SEQMIS during packet error */
398
    err_seqmis = 1;
399

  
400 398
    if ((rcv_imms & DBDES_MS) != (n->imms & DBDES_MS))
401 399
      DROP("MS-bit mismatch", rcv_imms);
402 400

  
......
422 420
	return;
423 421

  
424 422
      if (!(n->myimms & DBDES_M) && !(n->imms & DBDES_M))
423
      {
424
	tm_stop(n->dbdes_timer);
425 425
	ospf_neigh_sm(n, INM_EXDONE);
426
      else
427
	ospf_send_dbdes(p, n);
426
	break;
427
      }
428

  
429
      ospf_send_dbdes(p, n);
430
      tm_start(n->dbdes_timer, n->ifa->rxmtint);
428 431
    }
429 432
    else
430 433
    {
......
440 443
	return;
441 444

  
442 445
      ospf_send_dbdes(p, n);
446

  
447
      if (!(n->myimms & DBDES_M) && !(n->imms & DBDES_M))
448
	ospf_neigh_sm(n, INM_EXDONE);
443 449
    }
444 450
    break;
445 451

  
......
450 456
	(rcv_ddseq == n->ddr))
451 457
      goto duplicate;
452 458

  
453
    err_seqmis = 1;
454

  
455 459
    DROP("too late for DD exchange", n->state);
456 460

  
457 461
  default:
......
471 475
  LOG_PKT("Bad DBDES packet from nbr %R on %s - %s (%u)",
472 476
	  n->rid, ifa->ifname, err_dsc, err_val);
473 477

  
474
  if (err_seqmis)
475
    ospf_neigh_sm(n, INM_SEQMIS);
478
  ospf_neigh_sm(n, INM_SEQMIS);
476 479
  return;
477 480
}

Also available in: Unified diff