Use EXTRACT_IPV4_TO_NETWORK_ORDER() when checking an address against 0.

It may do less work than EXTRACT_IPV4_TO_HOST_ORDER(), and the byte
order doesn't matter when comparing against 0.
This commit is contained in:
Guy Harris 2018-01-30 14:42:40 -08:00
parent 6babce0e17
commit 7f952dfbb3

View File

@ -761,11 +761,11 @@ ospf_print_lsa(netdissect_options *ndo,
ND_PRINT(" %u", (ul & ASLA_MASK_METRIC));
ND_TCHECK_4(almp->asla_forward);
if (EXTRACT_IPV4_TO_HOST_ORDER(almp->asla_forward) != 0) {
if (EXTRACT_IPV4_TO_NETWORK_ORDER(almp->asla_forward) != 0) {
ND_PRINT(", forward %s", ipaddr_string(ndo, almp->asla_forward));
}
ND_TCHECK_4(almp->asla_tag);
if (EXTRACT_IPV4_TO_HOST_ORDER(almp->asla_tag) != 0) {
if (EXTRACT_IPV4_TO_NETWORK_ORDER(almp->asla_tag) != 0) {
ND_PRINT(", tag %s", ipaddr_string(ndo, almp->asla_tag));
}
++almp;
@ -1147,7 +1147,7 @@ ospf_print(netdissect_options *ndo,
ND_PRINT("\n\tRouter-ID %s", ipaddr_string(ndo, op->ospf_routerid));
ND_TCHECK_4(op->ospf_areaid);
if (EXTRACT_IPV4_TO_HOST_ORDER(op->ospf_areaid) != 0)
if (EXTRACT_IPV4_TO_NETWORK_ORDER(op->ospf_areaid) != 0)
ND_PRINT(", Area %s", ipaddr_string(ndo, op->ospf_areaid));
else
ND_PRINT(", Backbone Area");