]> git.puffer.fish Git - mirror/frr.git/commitdiff
* isis_lsp.c: Put correct metric info into TE TLV's. Wide metric is
authorhasso <hasso>
Mon, 26 Sep 2005 18:06:47 +0000 (18:06 +0000)
committerhasso <hasso>
Mon, 26 Sep 2005 18:06:47 +0000 (18:06 +0000)
  used only if only wide metric style (extended TLV's) is in use.

isisd/ChangeLog
isisd/isis_lsp.c

index 521df90c774f8c53c7d74989f97943876e39aa1c..e3fe62570168b04ef895d27b822cfe4f76189136 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-26 Hasso Tepper <hasso at quagga.net>
+
+       * isis_lsp.c: Put correct metric info into TE TLV's. Wide metric is
+         used only if only wide metric style (extended TLV's) is in use.
+
 2005-09-26 Hasso Tepper <hasso at quagga.net>
 
        * isis_tlv.[ch]: New function tlv_add_in_addr() to put just one IPv4
index 81d189dfd9de495e700b7bb0def8746d5ff606ae..394aadab885ae412107a6e7d3062184eca20b717 100644 (file)
@@ -1199,7 +1199,12 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
                  te_ipreach = XCALLOC (MTYPE_ISIS_TLV,
                                        sizeof (struct te_ipv4_reachability) +
                                        ((ipv4->prefixlen + 7)/8) - 1);
-                 te_ipreach->te_metric = htonl (*circuit->te_metric);
+
+                 if (area->oldmetric)
+                   te_ipreach->te_metric = htonl (circuit->metrics[level - 1].metric_default);
+                 else
+                   te_ipreach->te_metric = htonl (circuit->te_metric[level - 1]);
+
                  te_ipreach->control = (ipv4->prefixlen & 0x3F);
                  memcpy (&te_ipreach->prefix_start, &ipv4->prefix.s_addr,
                          (ipv4->prefixlen + 7)/8);
@@ -1225,8 +1230,13 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
            {
              ip6reach =
                XCALLOC (MTYPE_ISIS_TLV, sizeof (struct ipv6_reachability));
-             ip6reach->metric =
-               htonl (circuit->metrics[level - 1].metric_default);
+
+             if (area->oldmetric)
+               ip6reach->metric =
+                         htonl (circuit->metrics[level - 1].metric_default);
+             else
+                 ip6reach->metric = htonl (circuit->te_metric[level - 1]);
+
              ip6reach->control_info = 0;
              ip6reach->prefix_len = ipv6->prefixlen;
              memcpy (&ip6prefix, &ipv6, sizeof(ip6prefix));
@@ -1278,7 +1288,13 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
                  else
                    memcpy (te_is_neigh->neigh_id,
                            circuit->u.bc.l2_desig_is, ISIS_SYS_ID_LEN + 1);
-                 metric = ((htonl(*circuit->te_metric) >> 8) & 0xffffff);
+                 if (area->oldmetric)
+                   metric =
+                     ((htonl(circuit->metrics[level - 1].metric_default) >> 8)
+                             & 0xffffff);
+                 else
+                   metric = ((htonl(*circuit->te_metric) >> 8) & 0xffffff);
+
                  memcpy (te_is_neigh->te_metric, &metric, 3);
                  listnode_add (tlv_data.te_is_neighs, te_is_neigh);
                }