Mixing ip_addr and u32 does bad things on Ultrasparc.
Although both have the same size. Fascinating.
It was not catched by compiler because of varargs.
{
OSPF_TRACE(D_EVENTS,
"Changing state of virtual link %I from \"%s\" into \"%s\".",
- ifa->vid, ospf_is[oldstate], ospf_is[state]);
+ ipa_from_u32(ifa->vid), ospf_is[oldstate], ospf_is[state]);
if (state == OSPF_IS_PTP)
{
ifa->ip_sk = ospf_open_ip_socket(ifa);
strict = "";
if (ifa->type == OSPF_IT_VLINK)
{
- cli_msg(-1015, "Virtual link to %I:", ifa->vid);
- cli_msg(-1015, "\tTransit area: %I (%u)", ifa->voa->areaid,
+ cli_msg(-1015, "Virtual link to %I:", ipa_from_u32(ifa->vid));
+ cli_msg(-1015, "\tTransit area: %I (%u)", ipa_from_u32(ifa->voa->areaid),
ifa->voa->areaid);
}
else
cli_msg(-1015, "Interface \"%s\":",
(ifa->iface ? ifa->iface->name : "(none)"));
cli_msg(-1015, "\tType: %s %s", ospf_it[ifa->type], strict);
- cli_msg(-1015, "\tArea: %I (%u)", ifa->oa->areaid, ifa->oa->areaid);
+ cli_msg(-1015, "\tArea: %I (%u)", ipa_from_u32(ifa->oa->areaid), ifa->oa->areaid);
}
cli_msg(-1015, "\tState: %s %s", ospf_is[ifa->state],
ifa->stub ? "(stub)" : "");
cli_msg(-1015, "\tPriority: %u", ifa->priority);
cli_msg(-1015, "\tCost: %u", ifa->cost);
cli_msg(-1015, "\tHello timer: %u", ifa->helloint);
+
if (ifa->type == OSPF_IT_NBMA)
{
cli_msg(-1015, "\tPoll timer: %u", ifa->pollint);
cli_msg(-1015, "\tRetransmit timer: %u", ifa->rxmtint);
if ((ifa->type == OSPF_IT_BCAST) || (ifa->type == OSPF_IT_NBMA))
{
- cli_msg(-1015, "\tDesigned router (ID): %I", ifa->drid);
+ cli_msg(-1015, "\tDesigned router (ID): %I", ipa_from_u32(ifa->drid));
cli_msg(-1015, "\tDesigned router (IP): %I", ifa->drip);
- cli_msg(-1015, "\tBackup designed router (ID): %I", ifa->bdrid);
+ cli_msg(-1015, "\tBackup designed router (ID): %I", ipa_from_u32(ifa->bdrid));
cli_msg(-1015, "\tBackup designed router (IP): %I", ifa->bdrip);
}
}
memcpy(&no->lsa, h, sizeof(struct ospf_lsa_header));
add_tail(&n->ackl[queue], NODE no);
DBG("Adding (%s) ack for %I, ID: %I, RT: %I, Type: %u\n", s_queue[queue],
- n->rid, ntohl(h->id), ntohl(h->rt), h->type);
+ ipa_from_u32(n->rid), ipa_from_u32(ntohl(h->id)), ipa_from_u32(ntohl(h->rt)), h->type);
}
void
no = (struct lsah_n *) HEAD(n->ackl[queue]);
memcpy(h + i, &no->lsa, sizeof(struct ospf_lsa_header));
i++;
- DBG("Iter %u ID: %I, RT: %I, Type: %u\n", i, ntohl((h + i)->id),
- ntohl((h + i)->rt), (h + i)->type);
+ DBG("Iter %u ID: %I, RT: %I, Type: %u\n", i, ipa_from_u32(ntohl((h + i)->id)),
+ ipa_from_u32(ntohl((h + i)->rt)), (h + i)->type);
rem_node(NODE no);
mb_free(no);
if ((i * sizeof(struct ospf_lsa_header) +
}
DBG("Deleting LS Id: %I RT: %I Type: %u from LS Retl for neighbor %I\n",
- lsa.id, lsa.rt, lsa.type, n->rid);
+ ipa_from_u32(lsa.id), ipa_from_u32(lsa.rt), lsa.type, ipa_from_u32(n->rid));
s_rem_node(SNODE en);
if (en->lsa_body != NULL)
mb_free(en->lsa_body);
{
OSPF_TRACE(D_EVENTS, "Interface: %s", (ifa->iface ? ifa->iface->name : "(null)"));
OSPF_TRACE(D_EVENTS, "state: %u", ifa->state);
- OSPF_TRACE(D_EVENTS, "DR: %I", ifa->drid);
- OSPF_TRACE(D_EVENTS, "BDR: %I", ifa->bdrid);
+ OSPF_TRACE(D_EVENTS, "DR: %I", ipa_from_u32(ifa->drid));
+ OSPF_TRACE(D_EVENTS, "BDR: %I", ipa_from_u32(ifa->bdrid));
WALK_LIST(n, ifa->neigh_list)
{
- OSPF_TRACE(D_EVENTS, " neighbor %I in state %u", n->rid, n->state);
+ OSPF_TRACE(D_EVENTS, " neighbor %I in state %u", ipa_from_u32(n->rid), n->state);
}
}
struct proto *p = &oa->po->proto;
OSPF_TRACE(D_EVENTS, "Scheduling RT lsa origination for area %I.",
- oa->areaid);
+ ipa_from_u32(oa->areaid));
oa->origrt = 1;
}
WALK_LIST(oa, po->area_list)
{
- cli_msg(-1014, "\tArea: %I (%u) %s", oa->areaid, oa->areaid,
+ cli_msg(-1014, "\tArea: %I (%u) %s", ipa_from_u32(oa->areaid), oa->areaid,
oa->areaid == 0 ? "[BACKBONE]" : "");
ifano = 0;
nno = 0;
for (i = 0; i < rt->links; i++)
if (rr[i].type == LSART_PTP)
- cli_msg(-1016, "\t\trouter %I metric %u ", rr[i].id, rr[i].metric);
+ cli_msg(-1016, "\t\trouter %I metric %u ", ipa_from_u32(rr[i].id), rr[i].metric);
for (i = 0; i < rt->links; i++)
if (rr[i].type == LSART_NET)
cli_msg(-1016, "");
cli_msg(-1016, "\tnetwork %I/%d", ipa_and(ipa_from_u32(lsa->id), ln->netmask), ipa_mklen(ln->netmask));
- cli_msg(-1016, "\t\tdr %I", lsa->rt);
+ cli_msg(-1016, "\t\tdr %I", ipa_from_u32(lsa->rt));
for (i = 0; i < max; i++)
- cli_msg(-1016, "\t\trouter %I", rts[i]);
+ cli_msg(-1016, "\t\trouter %I", ipa_from_u32(rts[i]));
}
static inline void
static inline void
show_lsa_sum_rt(struct top_hash_entry *he)
{
- cli_msg(-1016, "\t\txrouter %I", he->lsa.id);
+ cli_msg(-1016, "\t\txrouter %I", ipa_from_u32(he->lsa.id));
}
if (last_area != hea[i]->oa->areaid)
{
cli_msg(-1016, "");
- cli_msg(-1016, "area %I", hea[i]->oa->areaid);
+ cli_msg(-1016, "area %I", ipa_from_u32(hea[i]->oa->areaid));
last_area = hea[i]->oa->areaid;
last_rt = 0xFFFFFFFF;
}
if ((hea[i]->lsa.rt != last_rt) && (hea[i]->lsa.type != LSA_T_NET))
{
cli_msg(-1016, "");
- cli_msg(-1016, (hea[i]->lsa.type != LSA_T_EXT) ? "\trouter %I" : "\txrouter %I", hea[i]->lsa.rt);
+ cli_msg(-1016, (hea[i]->lsa.type != LSA_T_EXT) ? "\trouter %I" : "\txrouter %I", ipa_from_u32(hea[i]->lsa.rt));
last_rt = hea[i]->lsa.rt;
}