Revision 6ff81197 proto/ospf/topology.c

View differences:

proto/ospf/topology.c
1424 1424
  struct ospf_config *cf = (struct ospf_config *) (p->p.cf);
1425 1425
  struct ospf_iface *ifa;
1426 1426
  struct ospf_lsa_prefix *lp;
1427
  uint max = ospf_is_ip4(p) ? IP4_MAX_PREFIX_LENGTH : IP6_MAX_PREFIX_LENGTH;
1427 1428
  int host_addr = 0;
1428 1429
  int net_lsa;
1429 1430
  int i = 0;
......
1457 1458
	  (a->scope <= SCOPE_LINK))
1458 1459
	continue;
1459 1460

  
1460
      if (((a->prefix.pxlen < IP6_MAX_PREFIX_LENGTH) && net_lsa) ||
1461
      if (((a->prefix.pxlen < max) && net_lsa) ||
1461 1462
	  configured_stubnet(oa, a))
1462 1463
	continue;
1463 1464

  
......
1465 1466
	  (ifa->state == OSPF_IS_LOOP) ||
1466 1467
	  (ifa->type == OSPF_IT_PTMP))
1467 1468
      {
1468
	net_addr_ip6 net = NET_ADDR_IP6(a->ip, IP6_MAX_PREFIX_LENGTH);
1469
	lsab_put_prefix(p, (net_addr *) &net, 0);
1469
	net_addr net;
1470
	if (a->prefix.type == NET_IP4)
1471
	  net_fill_ip4(&net, ipa_to_ip4(a->ip), IP4_MAX_PREFIX_LENGTH);
1472
	else
1473
	  net_fill_ip6(&net, ipa_to_ip6(a->ip), IP6_MAX_PREFIX_LENGTH);
1474

  
1475
	lsab_put_prefix(p, &net, 0);
1470 1476
	host_addr = 1;
1471 1477
      }
1472 1478
      else
......
1482 1488
    if (!sn->hidden)
1483 1489
    {
1484 1490
      lsab_put_prefix(p, &sn->prefix, sn->cost);
1485
      if (sn->prefix.pxlen == IP6_MAX_PREFIX_LENGTH)
1491
      if (sn->prefix.pxlen == max)
1486 1492
	host_addr = 1;
1487 1493
      i++;
1488 1494
    }

Also available in: Unified diff