Revision 061ab802 proto/ospf/lsupd.c

View differences:

proto/ospf/lsupd.c
78 78

  
79 79
#else /* OSPFv3 */
80 80

  
81
static int
82
unknown_lsa_type(struct ospf_lsa_header *lsa)
83
{
84
  switch (lsa->type)
85
    {
86
    case LSA_T_RT:
87
    case LSA_T_NET:
88
    case LSA_T_SUM_NET:
89
    case LSA_T_SUM_RT:
90
    case LSA_T_EXT:
91
    case LSA_T_LINK:
92
    case LSA_T_PREFIX:
93
      return 0;
94

  
95
    default:
96
      return 1;
97
    }
98
}
99

  
81 100
int
82 101
ospf_lsa_flooding_allowed(struct ospf_lsa_header *lsa, u32 domain, struct ospf_iface *ifa)
83 102
{    
84 103
  u32 scope = LSA_SCOPE(lsa);
85 104

  
86 105
  /* 4.5.2 (Case 2) */
87
  if (unknown_type(lsa) && !(lsa->type & LSA_UBIT))
106
  if (unknown_lsa_type(lsa) && !(lsa->type & LSA_UBIT))
88 107
    scope = LSA_SCOPE_LINK;
89 108

  
90 109
  switch (scope)
......
444 463

  
445 464
    /* pg 143 (1) */
446 465
    chsum = lsa->checksum;
466
    log(L_WARN "Checking rcv %R %R %d (len %d)", ntohl(lsa->id), ntohl(lsa->rt), ntoht(lsa->type), ntohs(lsa->length));
467
    buf_dump("RCV", lsa, ntohs(lsa->length));
447 468
    if (chsum != lsasum_check(lsa, NULL))
448 469
    {
449
      log(L_WARN "Received bad lsa checksum from %I", n->ip);
470
      log(L_WARN "Received bad lsa checksum from %I: %x %x", n->ip, chsum, lsa->checksum);
450 471
      continue;
451 472
    }
452 473

  

Also available in: Unified diff