summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Hilliard <nick@inex.ie>2012-11-28 14:39:56 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2012-12-12 15:38:14 +0100
commite1a555b67cc868f95ea2b53c278bd8d091333e5f (patch)
treec6d2a170693da4b78ed977b1badf9c38f84c693d
parent478c1125cfcf92c3f2a574d6b76eea28126284dc (diff)
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 <equinox@opensourcerouting.org>
-rw-r--r--isisd/isis_spf.c2
1 files changed, 1 insertions, 1 deletions
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;