Browse Source

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>
Nick Hilliard 8 years ago
parent
commit
e1a555b67c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      isisd/isis_spf.c

+ 1 - 1
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;