From f9bdcad4694cf80690982dfc58d28f91216c8bd0 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 5 Jul 2009 19:01:54 +0200 Subject: Fixes type mismatch in OSPF printf statements. 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. --- proto/ospf/ospf.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'proto/ospf/ospf.c') diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index c9b5f43..4a67128 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -209,11 +209,11 @@ ospf_dump(struct proto *p) { 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); } } @@ -310,7 +310,7 @@ schedule_rt_lsa(struct ospf_area *oa) 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; } @@ -953,7 +953,7 @@ ospf_sh(struct proto *p) 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; @@ -1088,7 +1088,7 @@ show_lsa_router(struct top_hash_entry *he) 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) @@ -1125,10 +1125,10 @@ show_lsa_network(struct top_hash_entry *he) 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 @@ -1143,7 +1143,7 @@ show_lsa_sum_net(struct top_hash_entry *he) 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)); } @@ -1207,7 +1207,7 @@ ospf_sh_state(struct proto *p, int verbose) 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; } @@ -1215,7 +1215,7 @@ ospf_sh_state(struct proto *p, int verbose) 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; } -- cgit v1.2.3