summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorhasso <hasso>2004-04-06 12:07:06 +0000
committerhasso <hasso>2004-04-06 12:07:06 +0000
commit34195bf6ddec586df823c4adecd692424cf3a0fe (patch)
treeae874ef2847cc5598e97e3530ae264cb5b771a00 /zebra/rt_netlink.c
parent41d3fc96959c9dea614822dfbb1891cd9a6f38a4 (diff)
[quagga-dev 1002]. Also fix date of previous commit in Chanelog.
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index e50f12f7..fed8829b 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -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)