From 7f952dfbb3ffd7fa937af4c97f5e58cdf03e4aab Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 30 Jan 2018 14:42:40 -0800 Subject: [PATCH] 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. --- print-ospf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/print-ospf.c b/print-ospf.c index e36f8184..b177d1d7 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -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");