]> git.puffer.fish Git - mirror/frr.git/commitdiff
[quagga-dev 1002]. Also fix date of previous commit in Chanelog.
authorhasso <hasso>
Tue, 6 Apr 2004 12:07:06 +0000 (12:07 +0000)
committerhasso <hasso>
Tue, 6 Apr 2004 12:07:06 +0000 (12:07 +0000)
zebra/ChangeLog
zebra/rt_netlink.c

index d337a3e5295d92f5dc9850643a0d61c8f4837120..981c85ceedd0778ba460bfe8d14feac9ee4c62c6 100644 (file)
@@ -1,4 +1,9 @@
-2004-04-18  Hasso Tepper <hasso@estpak.ee>
+2004-04-06  Krzysztof Oledzki <oleq@ans.pl>
+
+       * rt_netlink.c: Do not ignore metric when reading kernel routing
+         table on Linux with rt_netlink interface.
+
+2004-03-18  Hasso Tepper <hasso@estpak.ee>
 
        * interface.c: Temporary fix for handling secondary addresses
          with label.
index e50f12f7cef1bb797aac5a9d5e5bb4343c6b21dc..fed8829be03f5ee3b15802026adbdb3e46964cdb 100644 (file)
@@ -633,6 +633,8 @@ netlink_routing_table (struct sockaddr_nl *snl, struct nlmsghdr *h)
 
   int index;
   int table;
+  int metric;
+
   void *dest;
   void *gate;
 
@@ -671,6 +673,7 @@ netlink_routing_table (struct sockaddr_nl *snl, struct nlmsghdr *h)
     flags |= ZEBRA_FLAG_SELFROUTE;
 
   index = 0;
+  metric = 0;
   dest = NULL;
   gate = NULL;
 
@@ -686,6 +689,9 @@ netlink_routing_table (struct sockaddr_nl *snl, struct nlmsghdr *h)
   if (tb[RTA_GATEWAY])
     gate = RTA_DATA (tb[RTA_GATEWAY]);
 
+  if (tb[RTA_PRIORITY])
+    metric = *(int *) RTA_DATA(tb[RTA_PRIORITY]);
+
   if (rtm->rtm_family == AF_INET)
     {
       struct prefix_ipv4 p;
@@ -693,7 +699,7 @@ netlink_routing_table (struct sockaddr_nl *snl, struct nlmsghdr *h)
       memcpy (&p.prefix, dest, 4);
       p.prefixlen = rtm->rtm_dst_len;
 
-      rib_add_ipv4 (ZEBRA_ROUTE_KERNEL, flags, &p, gate, index, table, 0, 0);
+      rib_add_ipv4 (ZEBRA_ROUTE_KERNEL, flags, &p, gate, index, table, metric, 0);
     }
 #ifdef HAVE_IPV6
   if (rtm->rtm_family == AF_INET6)