From f171c0f1dbd8b8a4f58da170aaed178be00997b4 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 19 Jun 2013 16:32:22 +0000 Subject: [PATCH] The loopback route should also use the metric. --- if-linux.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/if-linux.c b/if-linux.c index 6ec6d004..fc3da199 100644 --- a/if-linux.c +++ b/if-linux.c @@ -632,10 +632,9 @@ if_route(const struct rt *rt, int action) add_attr_l(&nlm->hdr, sizeof(*nlm), RTA_GATEWAY, &rt->gate.s_addr, sizeof(rt->gate.s_addr)); - if (rt->gate.s_addr != htonl(INADDR_LOOPBACK)) { + if (rt->gate.s_addr != htonl(INADDR_LOOPBACK)) add_attr_32(&nlm->hdr, sizeof(*nlm), RTA_OIF, rt->iface->index); - add_attr_32(&nlm->hdr, sizeof(*nlm), RTA_PRIORITY, rt->metric); - } + add_attr_32(&nlm->hdr, sizeof(*nlm), RTA_PRIORITY, rt->metric); if (send_netlink(&nlm->hdr) == -1) retval = -1; -- 2.47.3