Revision fe9f1a6d proto/ospf/lsalib.c

View differences:

proto/ospf/lsalib.c
280 280

  
281 281

  
282 282
void
283
lsa_parse_sum_net(struct top_hash_entry *en, int ospf2, ip_addr *ip, int *pxlen, u8 *pxopts, u32 *metric)
283
lsa_parse_sum_net(struct top_hash_entry *en, int ospf2, net_addr *net, u8 *pxopts, u32 *metric)
284 284
{
285 285
  if (ospf2)
286 286
  {
287 287
    struct ospf_lsa_sum2 *ls = en->lsa_body;
288
    *ip = ipa_from_u32(en->lsa.id & ls->netmask);
289
    *pxlen = u32_masklen(ls->netmask);
288
    net_fill_ip4(net, ip4_from_u32(en->lsa.id & ls->netmask), u32_masklen(ls->netmask));
290 289
    *pxopts = 0;
291 290
    *metric = ls->metric & LSA_METRIC_MASK;
292 291
  }
293 292
  else
294 293
  {
295 294
    struct ospf_lsa_sum3_net *ls = en->lsa_body;
296
    u16 rest;
297
    lsa_get_ipv6_prefix(ls->prefix, ip, pxlen, pxopts, &rest);
295
    ospf_get_ipv6_prefix(ls->prefix, net, pxopts, NULL);
298 296
    *metric = ls->metric & LSA_METRIC_MASK;
299 297
  }
300 298
}
......
324 322
  if (ospf2)
325 323
  {
326 324
    struct ospf_lsa_ext2 *ext = en->lsa_body;
327
    rt->ip = ipa_from_u32(en->lsa.id & ext->netmask);
328
    rt->pxlen = u32_masklen(ext->netmask);
325
    net_fill_ip4(&rt->net,
326
		 ip4_from_u32(en->lsa.id & ext->netmask),
327
		 u32_masklen(ext->netmask));
329 328
    rt->pxopts = 0;
330 329
    rt->metric = ext->metric & LSA_METRIC_MASK;
331 330
    rt->ebit = ext->metric & LSA_EXT2_EBIT;
......
339 338
  else
340 339
  {
341 340
    struct ospf_lsa_ext3 *ext = en->lsa_body;
342
    u16 rest;
343
    u32 *buf = lsa_get_ipv6_prefix(ext->rest, &rt->ip, &rt->pxlen, &rt->pxopts, &rest);
341
    u32 *buf = ospf_get_ipv6_prefix(ext->rest, &rt->net, &rt->pxopts, NULL);
344 342
    rt->metric = ext->metric & LSA_METRIC_MASK;
345 343
    rt->ebit = ext->metric & LSA_EXT3_EBIT;
346 344

  
347 345
    rt->fbit = ext->metric & LSA_EXT3_FBIT;
348 346
    if (rt->fbit)
349
      buf = lsa_get_ipv6_addr(buf, &rt->fwaddr);
347
      buf = ospf_get_ipv6_addr(buf, &rt->fwaddr);
350 348
    else
351 349
      rt->fwaddr = IPA_NONE;
352 350

  
......
452 450
    return 0;
453 451

  
454 452
  u8 pxl = pxlen(body->prefix);
455
  if (pxl > MAX_PREFIX_LENGTH)
453
  if (pxl > IP6_MAX_PREFIX_LENGTH)
456 454
    return 0;
457 455

  
458 456
  if (lsa->length != (HDRLEN + sizeof(struct ospf_lsa_sum3_net) +
......
491 489
    return 0;
492 490

  
493 491
  u8 pxl = pxlen(body->rest);
494
  if (pxl > MAX_PREFIX_LENGTH)
492
  if (pxl > IP6_MAX_PREFIX_LENGTH)
495 493
    return 0;
496 494

  
497 495
  int len = IPV6_PREFIX_SPACE(pxl);
......
520 518
	return 0;
521 519

  
522 520
      u8 pxl = pxlen((u32 *) (pbuf + offset));
523
      if (pxl > MAX_PREFIX_LENGTH)
521
      if (pxl > IP6_MAX_PREFIX_LENGTH)
524 522
	return 0;
525 523

  
526 524
      offset += IPV6_PREFIX_SPACE(pxl);

Also available in: Unified diff