From e1a555b67cc868f95ea2b53c278bd8d091333e5f Mon Sep 17 00:00:00 2001 From: Nick Hilliard Date: Wed, 28 Nov 2012 14:39:56 +0000 Subject: isisd: fix ipv6 metric endianness the isis ipv6 reachability metric is transmitted in big endian / network format, but isis_spf_process_lsp() does not convert this into host endian format when mucking around with local cost + received metric. This patch fixes this problem and makes received ipv6 metrics work properly on little-endian machines. Signed-off-by: David Lamparter --- isisd/isis_spf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'isisd') diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index e0a8d01c..fd93efa6 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -833,7 +833,7 @@ lspfragloop: { assert (ip6reach->prefix_len <= IPV6_MAX_BITLEN); - dist = cost + ip6reach->metric; + dist = cost + ntohl(ip6reach->metric); vtype = (ip6reach->control_info & CTRL_INFO_DISTRIBUTION) ? VTYPE_IP6REACH_EXTERNAL : VTYPE_IP6REACH_INTERNAL; prefix.prefixlen = ip6reach->prefix_len; -- cgit v1.2.1