* to the message, otherwise false is returned.
*/
static int netlink_route_nexthop_encap(bool fpm, struct nlmsghdr *n,
- size_t nlen, struct nexthop *nh)
+ size_t nlen, const struct nexthop *nh)
{
struct rtattr *nest;
* The function returns true if the nexthop could be added
* to the message, otherwise false is returned.
*/
-static bool _netlink_route_build_multipath(
- const struct prefix *p, const char *routedesc, int bytelen,
- const struct nexthop *nexthop, struct nlmsghdr *nlmsg, size_t req_size,
- struct rtmsg *rtmsg, const union g_addr **src, route_tag_t tag)
+static bool _netlink_route_build_multipath(const struct prefix *p,
+ const char *routedesc, int bytelen,
+ const struct nexthop *nexthop,
+ struct nlmsghdr *nlmsg,
+ size_t req_size, struct rtmsg *rtmsg,
+ const union g_addr **src,
+ route_tag_t tag, bool fpm)
{
char label_buf[256];
struct vrf *vrf;
if (!_netlink_set_tag(nlmsg, req_size, tag))
return false;
+ /*
+ * Add encapsulation information when installing via
+ * FPM.
+ */
+ if (!netlink_route_nexthop_encap(fpm, nlmsg, req_size, nexthop))
+ return false;
+
nl_attr_rtnh_end(nlmsg, rtnh);
return true;
}
bytelen = (family == AF_INET ? 4 : 16);
return _netlink_route_build_multipath(p, routedesc, bytelen,
nhlfe->nexthop, nlmsg, req_size,
- rtmsg, src, 0);
+ rtmsg, src, 0, false);
}
static void _netlink_mpls_debug(int cmd, uint32_t label, const char *routedesc)
: "multipath";
nexthop_num++;
- if (!_netlink_route_build_multipath(
- p, routedesc, bytelen, nexthop,
- &req->n, datalen, &req->r, &src1,
- tag))
- return 0;
-
- /*
- * Add encapsulation information when installing via
- * FPM.
- */
- if (!netlink_route_nexthop_encap(fpm, &req->n,
- datalen,
- nexthop))
+ if (!_netlink_route_build_multipath(p, routedesc,
+ bytelen,
+ nexthop,
+ &req->n,
+ datalen,
+ &req->r,
+ &src1, tag,
+ fpm))
return 0;
if (!setsrc && src1) {