summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2015-10-20 21:51:31 +0000
committerDaniel Walton <dwalton@cumulusnetworks.com>2015-10-20 21:51:31 +0000
commitdb07cdc49847e2f99d27d0e6ba0f199fba0ddf44 (patch)
tree693b82b63a1d3593ba7ec329362bdc11ac51bd83 /zebra/rt_netlink.c
parent12179ba3be86f23f37571554e2cebc13a6612717 (diff)
parent141973cbd8807908e742029aa297bf9950a2bcf8 (diff)
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index dfff7869aa..4c16df61a1 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1500,6 +1500,13 @@ _netlink_route_build_singlepath(
addattr_l (nlmsg, req_size, RTA_GATEWAY, &ipv4_ll, 4);
addattr32 (nlmsg, req_size, RTA_OIF, nexthop->ifindex);
+ if (nexthop->rmap_src.ipv4.s_addr && (cmd == RTM_NEWROUTE))
+ addattr_l (nlmsg, req_size, RTA_PREFSRC,
+ &nexthop->rmap_src.ipv4, bytelen);
+ else if (nexthop->src.ipv4.s_addr && (cmd == RTM_NEWROUTE))
+ addattr_l (nlmsg, req_size, RTA_PREFSRC,
+ &nexthop->src.ipv4, bytelen);
+
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug(" 5549: _netlink_route_build_singlepath() (%s): "
"nexthop via %s if %u",
@@ -1648,6 +1655,11 @@ _netlink_route_build_multipath(
rtnh->rtnh_len += sizeof (struct rtattr) + bytelen;
rtnh->rtnh_ifindex = nexthop->ifindex;
+ if (nexthop->rmap_src.ipv4.s_addr)
+ *src = &nexthop->rmap_src;
+ else if (nexthop->src.ipv4.s_addr)
+ *src = &nexthop->src;
+
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug(" 5549: netlink_route_build_multipath() (%s): "
"nexthop via %s if %u",