~ubuntu-branches/ubuntu/lucid/quagga/lucid-security

« back to all changes in this revision

Viewing changes to ospf6d/ospf6_lsa.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-05-05 19:21:02 UTC
  • mfrom: (17.1.15 sid)
  • Revision ID: package-import@ubuntu.com-20120505192102-vhdjnud7ast901mj
Tags: 0.99.20.1-0ubuntu0.10.04.2
* SECURITY UPDATE: Update to 0.99.20.1 to fix multiple security issues.
  (LP: #994169)
  - Denial of service via short Link State Update packet
  - Denial of service via short network-LSA link-state advertisement
  - Denial of service via malformed Four-octet AS Number Capability
  - CVE-2012-0249
  - CVE-2012-0250
  - CVE-2012-0255
* debian/control, debian/rules: Remove quagga-dbg package for Lucid.
* debian/rules: don't use autotools_dev for Lucid.
* debian/patches/99_bgpd-fix-memory-leak-for-extra-attributes.diff:
  added fix for a bgpd memory leak related to extra attributes. Thanks to
  Debian for the regression fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
    return 1;
164
164
  if (ntohs (lsa1->header->length) != ntohs (lsa2->header->length))
165
165
    return 1;
 
166
  /* Going beyond LSA headers to compare the payload only makes sense, when both LSAs aren't header-only. */
 
167
  if (CHECK_FLAG (lsa1->flag, OSPF6_LSA_HEADERONLY) != CHECK_FLAG (lsa2->flag, OSPF6_LSA_HEADERONLY))
 
168
  {
 
169
    zlog_warn ("%s: only one of two (%s, %s) LSAs compared is header-only", __func__, lsa1->name, lsa2->name);
 
170
    return 1;
 
171
  }
 
172
  if (CHECK_FLAG (lsa1->flag, OSPF6_LSA_HEADERONLY))
 
173
    return 0;
166
174
 
167
175
  length = OSPF6_LSA_SIZE (lsa1->header) - sizeof (struct ospf6_lsa_header);
168
 
  assert (length > 0);
 
176
  /* Once upper layer verifies LSAs received, length underrun should become a warning. */
 
177
  if (length <= 0)
 
178
    return 0;
169
179
 
170
180
  return memcmp (OSPF6_LSA_HEADER_END (lsa1->header),
171
181
                 OSPF6_LSA_HEADER_END (lsa2->header), length);
256
266
int
257
267
ospf6_lsa_compare (struct ospf6_lsa *a, struct ospf6_lsa *b)
258
268
{
259
 
  signed long seqnuma, seqnumb;
 
269
  int seqnuma, seqnumb;
260
270
  u_int16_t cksuma, cksumb;
261
271
  u_int16_t agea, ageb;
262
272
 
264
274
  assert (b && b->header);
265
275
  assert (OSPF6_LSA_IS_SAME (a, b));
266
276
 
267
 
  seqnuma = ((signed long) ntohl (a->header->seqnum))
268
 
             - (signed long) INITIAL_SEQUENCE_NUMBER;
269
 
  seqnumb = ((signed long) ntohl (b->header->seqnum))
270
 
             - (signed long) INITIAL_SEQUENCE_NUMBER;
 
277
  seqnuma = (int) ntohl (a->header->seqnum);
 
278
  seqnumb = (int) ntohl (b->header->seqnum);
271
279
 
272
280
  /* compare by sequence number */
273
 
  /* XXX, LS sequence number wrapping */
274
281
  if (seqnuma > seqnumb)
275
282
    return -1;
276
 
  else if (seqnuma < seqnumb)
 
283
  if (seqnuma < seqnumb)
277
284
    return 1;
278
285
 
279
286
  /* Checksum */
715
722
  ospf6_install_lsa_handler (&unknown_handler);
716
723
}
717
724
 
 
725
void
 
726
ospf6_lsa_terminate (void)
 
727
{
 
728
  vector_free (ospf6_lsa_handler_vector);
 
729
}
718
730
 
719
731
static char *
720
732
ospf6_lsa_handler_name (struct ospf6_lsa_handler *h)